/** * @expectedException Mollie_API_Exception * @expectedExceptionMessage You have not set an API key. Please use setApiKey() to set the API key. */ public function testNotSettingApiKeyGivesException() { $this->api = $this->getMock("Mollie_API_Client", array('getCompatibilityChecker'), array(), '', FALSE); $this->api->expects($this->any())->method("getCompatibilityChecker")->will($this->returnValue($this->compatibilityChecker)); $this->api->__construct(); $this->api->payments->all(); }