public function testCreatingEmptyWordListAndCountingParticularWordOccurences() { $wordList = new WordList(); $wordList->addWord('foo'); $wordList->addWord('foo'); $wordList->addWord('bar'); $wordList->addWord('baz'); $wordList->addWord('foo'); $this->assertSame(3, $wordList->countWordOccurences('foo')); $this->assertSame(1, $wordList->countWordOccurences('bar')); $this->assertSame(1, $wordList->countWordOccurences('baz')); $this->assertSame(0, $wordList->countWordOccurences('fooz')); }