/** * @expectedException BadMethodCallException * @expectedExceptionMessage Call to undefined method ExampleExtendableClass::protectedMars() */ public function testAccessingProtectedStaticMethod() { echo ExampleExtendableClass::protectedMars(); }
/** * @expectedException Exception * @expectedExceptionMessage Class ExampleExtendableClass does not have a method definition for undefinedMethod */ public function testCallingUndefinedStaticMethod() { $result = ExampleExtendableClass::undefinedMethod(); $this->assertEquals('bar', $result); }