Пример #1
0
 /**
  * Ensures that the allowWhiteSpace option works as expected
  *
  * @return void
  */
 public function testOptionToAllowWhiteSpaceWithBasicInputValues()
 {
     $this->validator->setAllowWhiteSpace(true);
     $valuesExpected = array('abc123' => true, 'abc 123' => true, 'abcxyz' => true, 'AZ@#4.3' => false, 'aBc123' => true, '' => false, ' ' => true, "\n" => true, " \t " => true, 'foobar1' => true);
     foreach ($valuesExpected as $input => $result) {
         $this->assertEquals($result, $this->validator->isValid($input), "Expected '{$input}' to be considered " . ($result ? '' : 'in') . "valid");
     }
 }