/** * Undeclared method test. * @return void */ public function testUndeclaredMethod() { $this->setExpectedException("MemberAccessException", "Call to undefined method TestClass::undeclared().", 0); $obj = new TestClass(); $obj->undeclared(); }