/** * @expectedException BadMethodCallException */ public function testCallsToUnknownMethodsFail() { $root = new SimpleDOM('<root><child /></root>'); try { $root->UNKNOWN_METHOD(); } catch (Exception $e) { $this->assertSame('Undefined method SimpleDOM::UNKNOWN_METHOD()', $e->getMessage()); throw $e; } }