TYPO3 CMS  TYPO3_6-2
EqualsValidatorTest.php
Go to the documentation of this file.
1 <?php
20 
24  protected $helper;
25 
29  protected $subject;
30 
31  public function setUp() {
32  $this->helper = new \TYPO3\CMS\Form\Tests\Unit\Validation\Helper();
33  $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\EqualsValidator', array('dummy'), array(), '', FALSE);
34  }
35 
36  public function invalidPairProvider() {
37  return array(
38  'somethingElse !== something' => array(array('somethingElse', 'something')),
39  '4 !== 3' => array(array(4, 3))
40  );
41  }
42 
47  public function isValidForInvalidInputReturnsFalse($input) {
48  $this->subject->setFieldName('myField');
49  $this->subject->setField($input[0]);
50  $requestHandlerMock = $this->helper->getRequestHandler(array(
51  'myField' => $input[1],
52  $input[0] => TRUE
53  ));
54  $this->subject->injectRequestHandler($requestHandlerMock);
55 
56  $this->assertFalse(
57  $this->subject->isValid()
58  );
59  }
60 }