public function testPopulateDictionary() { Dictionary::populateDictionary(); $this->dictionary = Dictionary::getDictionary(); $this->assertEquals(20, count($this->dictionary)); $this->assertNotEquals(21, count($this->dictionary)); }
public function run() { //populate dictionary Dictionary::populateDictionary(); //get the populated dictionary print "Populating the dictionary <br/>"; $dictionary = Dictionary::getDictionary(); var_export($dictionary); print "<br/>"; //create a word print "Creating a word<br/>"; $word = $this->dictionaryManager->createEntry('Excitement', 'A state of agitation or happiness', 'He was very excited at the thought of dinner with the Whites this night.'); var_export($word); print "<br/>"; //find a word print "Finding a word<br/>"; $foundWord = $this->dictionaryManager->findEntry('Excitement'); var_export($foundWord); print "<br/>"; //edit a word print "Editing a word<br/>"; $edited = $this->dictionaryManager->editEntry("Excitement", "Extreme happiness", "He wasn't very excited this morning. this."); var_export($edited); print "<br/>"; //rank word print "Ranking words<br/>"; try { $ranked = $this->rank->rankWords($this->dictionaryManager->findEntry('Excitement')); var_export($ranked); print "<br/>"; } catch (InvalidArgumentException $e) { echo $e->getMessage() . "<br/>"; } //delete a word print "Deleting a word<br/>"; $dictionary = $this->dictionaryManager->deleteEntry('Excitement'); var_export($dictionary); }
protected function setUp() { $this->dictionary = Dictionary::getDictionary(); $this->manager = new DictionaryManager(); $this->populatedDictionary = Dictionary::populateDictionary(); }