コード例 #1
0
ファイル: InputTest.php プロジェクト: rexmac/zf2
 public function testNamespaceExceptionInvalidClass()
 {
     $data = array('field1' => 'abc');
     // Zend\Validator\Exception exists, but does not implement the needed interface
     $broker = new Validator\ValidatorBroker();
     $broker->getClassLoader()->registerPlugin('exception', 'Zend\\Validator\\Exception');
     $validators = array('field1' => 'Exception');
     $input = new InputFilter(null, $validators, $data);
     $input->setPluginBroker($broker, InputFilter::VALIDATOR);
     $this->setExpectedException('Zend\\Validator\\Exception', 'must implement');
     $this->assertTrue($input->hasInvalid(), 'Expected hasInvalid() to return true');
 }