Exemplo n.º 1
0
 public function testBadMethodCall()
 {
     try {
         $cite = new Cite();
         $cite->foo();
         $this->fail('Call to unknown method should throw an exception!');
     } catch (BadMethodCallException $e) {
         $this->assertEquals("Does not recognize method with name 'foo'!", $e->getMessage());
     }
     try {
         $cite = new Cite(array('foo' => 'bar'));
         $this->fail('Construct with unknown property should throw an exception!');
     } catch (InvalidArgumentException $e) {
         $this->assertEquals('Can not set property \'foo\'!', $e->getMessage());
     }
 }