/**
  * @test
  * @dataProvider invalidIpv4Provider
  */
 public function isValidForInvalidInputReturnsFalse($input)
 {
     $this->fixture->setFieldName('myIp');
     $requestHandlerMock = $this->helper->getRequestHandler(array('myIp' => $input));
     $this->fixture->injectRequestHandler($requestHandlerMock);
     $this->assertFalse($this->fixture->isValid());
 }
 /**
  * @test
  * @dataProvider invalidDataProvider
  */
 public function isValidForInvalidDataReturnsFalse($input)
 {
     $this->subject->setFieldName('myRequired');
     $requestHandlerMock = $this->helper->getRequestHandler(array('myRequired' => $input));
     $this->subject->injectRequestHandler($requestHandlerMock);
     $this->assertFalse($this->subject->isValid());
 }
 /**
  * @test
  * @dataProvider invalidTypesProvider
  */
 public function isValidForInvalidInputReturnsFalse($input)
 {
     $this->subject->setFieldName('myFile');
     $this->subject->setAllowedTypes($input[0]);
     $requestHandlerMock = $this->helper->getRequestHandler(array('myFile' => array('type' => $input[1])));
     $this->subject->injectRequestHandler($requestHandlerMock);
     $this->assertFalse($this->subject->isValid());
 }
Esempio n. 4
0
 /**
  * @test
  * @dataProvider invalidPairProvider
  */
 public function isValidForInvalidInputReturnsFalse($input)
 {
     $this->subject->setFieldName('myField');
     $this->subject->setField($input[0]);
     $requestHandlerMock = $this->helper->getRequestHandler(array('myField' => $input[1], $input[0] => TRUE));
     $this->subject->injectRequestHandler($requestHandlerMock);
     $this->assertFalse($this->subject->isValid());
 }
 /**
  * @test
  * @dataProvider invalidIntegerProvider
  */
 public function isValidForInvalidInputReturnsFalse($input)
 {
     $this->subject->setFieldName('myFile');
     setlocale(LC_NUMERIC, $input[1]);
     $requestHandlerMock = $this->helper->getRequestHandler(array('myFile' => $input[0]));
     $this->subject->injectRequestHandler($requestHandlerMock);
     $this->assertFalse($this->subject->isValid());
 }
 /**
  * @test
  * @dataProvider invalidDataProvider
  */
 public function isValidForInvalidInputReturnsFalse($input)
 {
     $this->subject->setFieldName('myRegexp');
     $this->subject->setRegularExpression($input[0]);
     $requestHandlerMock = $this->helper->getRequestHandler(array('myRegexp' => $input[1]));
     $this->subject->injectRequestHandler($requestHandlerMock);
     $this->assertFalse($this->subject->isValid());
 }
 /**
  * @test
  * @dataProvider invalidLengthProvider
  */
 public function isValidForInvalidInputReturnsFalse($input)
 {
     $this->fixture->setFieldName('myLength');
     $this->fixture->setMinimum($input[0]);
     $this->fixture->setMaximum($input[1]);
     $requestHandlerMock = $this->helper->getRequestHandler(array('myLength' => $input[2]));
     $this->fixture->injectRequestHandler($requestHandlerMock);
     $this->assertFalse($this->fixture->isValid());
 }
 /**
  * @test
  * @dataProvider invalidDataProviderWithWhitespace
  */
 public function isValidForInvalidInputWithAllowedWhitespaceReturnsFalse($input)
 {
     $requestHandlerMock = $this->helper->getRequestHandler(array('name' => $input));
     $this->subject->setAllowWhiteSpace(TRUE);
     $this->subject->setFieldName('name');
     $this->subject->injectRequestHandler($requestHandlerMock);
     $this->assertFalse($this->subject->isValid());
 }
 /**
  * @test
  * @dataProvider invalidArrayProvider
  */
 public function isValidForInvalidInputWithStrictComparisonReturnsFalse($input)
 {
     $this->subject->setFieldName('myfield');
     $this->subject->setArray($input[0]);
     $this->subject->setStrict(TRUE);
     $requestHandlerMock = $this->helper->getRequestHandler(array('myfield' => $input[1]));
     $this->subject->injectRequestHandler($requestHandlerMock);
     $this->assertFalse($this->subject->isValid());
 }
 /**
  * @test
  * @dataProvider invalidInclusiveDataProvider
  */
 public function isValidWithInvalidInputAndWithInclusiveReturnsFalse($input)
 {
     $this->fixture->setMinimum($input[0]);
     $this->fixture->setMaximum($input[2]);
     $this->fixture->setFieldName('numericValue');
     $this->fixture->setInclusive(TRUE);
     $requestHandlerMock = $this->helper->getRequestHandler(array('numericValue' => $input[1]));
     $this->fixture->injectRequestHandler($requestHandlerMock);
     $this->assertFalse($this->fixture->isValid());
 }