public function test__call() { $sut = new Dfp_Datafeed_File_Reader(); $mockFormat = $this->getMock('Dfp_Datafeed_File_Reader_Format_Xml'); $mockFormat->expects($this->once())->method('setXslt')->with($this->equalTo('xslt')); $passed = false; try { $sut->setXslt('xslt'); } catch (Dfp_Datafeed_File_Reader_Exception $e) { if ($e->getMessage() == 'Method setXslt dosn\'t exist in format class') { $passed = true; } } $sut->setFormat($mockFormat); $sut->setXslt('xslt'); $this->assertTrue($passed); }