Ejemplo n.º 1
0
 public function testToArrayString()
 {
     $this->assertEquals(['с', 'т', 'р', 'о', 'к', 'а'], String::asArray('строка'));
     $this->assertEquals(['s', 't', 'r', 'i', 'n', 'g'], String::asArray('string'));
 }
 /**
  * @param string $firstWord
  * @param string $secondWord
  * @return boolean
  */
 public function alike($firstWord, $secondWord)
 {
     $varianceLetters = count(array_diff_assoc(String::asArray($firstWord), String::asArray($secondWord)));
     return $varianceLetters == self::MATCHED_COUNT_LETTERS;
 }