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 setNewValidatorConjunctionCreatesANewValidatorConjunctionObject()
 {
     $argument = new Tx_Extbase_MVC_Controller_Argument('dummy', 'Text');
     $argument->setNewValidatorConjunction(array());
     $this->assertType('Tx_Extbase_Validation_Validator_ConjunctionValidator', $argument->getValidator(), 'The returned validator is not a conjunction as expected.');
 }