Example #1
0
 /**
  * @test
  */
 public function setNewValidatorConjunctionCreatesANewValidatorConjunctionObject()
 {
     $argument = new Tx_Extbase_MVC_Controller_Argument('dummy', 'Text');
     $mockConjunctionValidator = $this->getMock('Tx_Extbase_Validation_Validator_ConjunctionValidator');
     $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
     $mockObjectManager->expects($this->once())->method('create')->with('Tx_Extbase_Validation_Validator_ConjunctionValidator')->will($this->returnValue($mockConjunctionValidator));
     $argument->injectObjectManager($mockObjectManager);
     $argument->setNewValidatorConjunction(array());
     $this->assertSame($mockConjunctionValidator, $argument->getValidator());
 }
 /**
  * @test
  */
 public function dataTypeValidatorCanBeAShortName()
 {
     $this->markTestIncomplete();
     $this->mockObjectManager->expects($this->once())->method('isObjectRegistered')->with('Tx_Extbase_Validation_Validator_TextValidator')->will($this->returnValue(TRUE));
     $this->mockObjectManager->expects($this->any())->method('getObject')->with('Tx_Extbase_Validation_Validator_TextValidator')->will($this->returnValue($this->getMock('Tx_Extbase_Validation_Validator_TextValidator')));
     $argument = new Tx_Extbase_MVC_Controller_Argument('SomeArgument', 'Text');
     $argument->injectObjectManager($this->mockObjectManager);
     $this->assertType('Tx_Extbase_Validation_Validator_TextValidator', $argument->getDatatypeValidator(), 'The returned datatype validator is not a text validator as expected.');
 }