Exemple #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");
     }
 }