/** * Test a invalid service class * * @return void */ public function testInvalidServiceClass() { $validator = new Validator\CreditCard(); $this->assertEquals(null, $validator->getService()); try { $validator->setService(array('\\ZendTest\\Validator\\CreditCardTest', 'nocallback')); $this->fail('Exception expected'); } catch (\Zend\Exception $e) { $this->assertContains('Invalid callback given', $e->getMessage()); } }
/** * Test a invalid service class * * @return void */ public function testInvalidServiceClass() { $validator = new Validator\CreditCard(); $this->assertEquals(null, $validator->getService()); $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'Invalid callback given'); $validator->setService(array('ZendTest\Validator\CreditCardTest', 'nocallback')); }