public function testGetLettersOfGivenType() { $configuration = new PronounceableWord_Configuration_LetterTypes(); $letterTypes = new PronounceableWord_LetterTypes($configuration); foreach ($configuration->letterTypesWithLetters as $letterType => $letters) { $this->assertSame($letters, $letterTypes->getLettersOfGivenType($letterType)); $maximumLetterIndex = strlen($letters); } }
public function testHaveLettersAtLeastOneLinkedLetterOfDifferentType() { $letterTypes = new PronounceableWord_LetterTypes($this->letterTypesConfiguration); $linkedLettersConfiguration = new PronounceableWord_Configuration_LinkedLetters(); foreach ($this->linkedLettersConfiguration->lettersWithLinkedLetters as $letter => $linkedLetters) { $letterType = $letterTypes->getLetterType($letter); $hasOneDifferentType = false; $maximumLetterIndex = strlen($linkedLetters); for ($letterIndex = 0; $letterIndex < $maximumLetterIndex; $letterIndex++) { $linkedLetterType = $letterTypes->getLetterType($linkedLetters[$letterIndex]); if ($letterType !== $linkedLetterType) { $hasOneDifferentType = true; break; } } $this->assertTrue($hasOneDifferentType); } }