Skip to content

Commit

Permalink
#111. Add skeleton for SpellCheckTest
Browse files Browse the repository at this point in the history
  • Loading branch information
a.kushman committed Jun 1, 2018
1 parent fc9526a commit 38fb783
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 6 deletions.
7 changes: 1 addition & 6 deletions src/extension/SpellCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ public function check(string $text)
*/
private function cleanText(string $text)
{
$cleanText = str_replace(',', '', $text);
$cleanText = str_replace('.', '', $cleanText);
$cleanText = str_replace('-', '', $cleanText);
$cleanText = str_replace('- ', '', $cleanText);
$cleanText = str_replace(':', '', $cleanText);
return str_replace('"', '', $cleanText);
return str_replace([',', '.', '-', '- ', ':', '"'], '', $text);
}

/**
Expand Down
66 changes: 66 additions & 0 deletions tests/unit/extension/SpellCheckTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
/**
* Created by PhpStorm.
* User: arthurkushman
* Date: 01/06/2018
* Time: 13:18
*/

namespace rjapitest\unit\extensions;


use rjapi\extension\SpellCheck;
use rjapitest\unit\TestCase;

/**
* Class SpellCheckTest
*
* @package rjapitest\unit\extensions
*
* @property SpellCheck spellCheck
*/
class SpellCheckTest extends TestCase
{
private $spellCheck;

/**
*
*/
public function setUp()
{
parent::setUp();
$this->spellCheck = new SpellCheck('article');
}

/**
* @test
*/
public function it_checks_text()
{

}

/**
* @test
*/
public function it_is_enabled()
{

}

/**
* @test
*/
public function it_gets_language()
{

}

/**
* @test
*/
public function it_get_field()
{

}
}

0 comments on commit 38fb783

Please sign in to comment.