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); } }
public function testGetLetterType() { $configuration = new PronounceableWord_Configuration_LetterTypes(); $letterTypes = new PronounceableWord_LetterTypes($configuration); foreach ($configuration->letterTypesWithLetters as $letterType => $letters) { $maximumLetterIndex = strlen($letters); for ($letterIndex = 0; $letterIndex < $maximumLetterIndex; $letterIndex++) { $letter = $letters[$letterIndex]; $this->assertSame($letterType, $letterTypes->getLetterType($letter)); } } }