public function testAddSingleWord() { $wordList = new WordList(); $wordList->addWord('php'); $words = self::getPropertyValue($wordList, 'words'); $this->assertArrayHasKey(3, $words); $this->assertContains('php', $words[3]); }
public function testAddSeveralWords() { $wordList = new WordList(); $wordList->addWord('argus'); $wordList->addWord('ruby'); $wordList->addWord('java'); $words = self::readProperty('words', $wordList); $this->assertArrayHasKey(4, $words); $this->assertArrayHasKey(5, $words); $this->assertCount(2, $words); $this->assertCount(2, $words[4]); $this->assertCount(1, $words[5]); $this->assertContains('java', $words[4]); $this->assertContains('ruby', $words[4]); $this->assertContains('argus', $words[5]); }
public function createRunner($withWordList = false) { $context = new GameContext($this->get('session')); $wordList = null; if ($withWordList) { $wordList = new WordList(); $wordList->addWord('hardware'); $wordList->addWord('software'); $wordList->addWord('aircraft'); } return new GameRunner($context, $wordList); }