public function testResultSuggestionIsArray() { $wordSpelling = new Cwin\BasicWord\WordSpelling(new WordFactoryIndonesia()); $suggestion = new Cwin\Component\Suggestion\Suggestion(); $checkSpelling = $wordSpelling->checkSpelling('mrdka'); foreach ($checkSpelling->spellingResult() as $spelling) { $this->assertTrue(is_array($suggestion->setSpelling($spelling)->suggest())); } }
public function testSpellingCorrectWord() { $wordSpelling = new Cwin\BasicWord\WordSpelling(new WordFactoryIndonesia()); $wordSpelling->addWord('indonesia'); $checkSpelling = $wordSpelling->checkSpelling(); foreach ($checkSpelling->spellingResult() as $spelling) { $this->assertFalse($spelling->hasError()); $this->assertInternalType('string', $spelling->getWord()); } }