/** * @expectedException \RuntimeException * @expectedExceptionMessage Call to undefined method: PageTree->getSomething() */ public function testAnExceptionIsThrownWhenCalledMethodDoesNotExists() { $pageTree = new PageTree($this->templateAssetsManager, $this->dispatcher, $this->dataManager); $pageTree->getSomething(); }