public function testSetGetLogger() { $log = \Phake::mock('Psr\\Log\\LoggerInterface'); $this->assertSame($log, $this->config->setLogger($log)->getLogger()); }
public function testWpFactoryEventDispatcherForGuzzleClientLogsWhenEventDispatch() { $config = new Config(); $config->setLogger(Phake::mock('\\Psr\\Log\\LoggerInterface')); $config->setApiBaseUrl("Invalid URL to prevent making actual calls"); $authService = Client::wpFactory($config)->auth(); try { $authService->deOrbit("Request ID"); } catch (\Exception $e) { // An exception should be thrown since the URL is invalid } Phake::verify($config->getLogger())->debug("Sending request", $this->anything()); }