public function testGetHttpInvokerThrowsExceptionIfGivenHttpInvokerClassCouldNotBeInstantiated() { /** @var \Dkd\PhpCmis\Bindings\BindingSessionInterface|\PHPUnit_Framework_MockObject_MockObject $sessionMock */ $sessionMock = $this->getMockBuilder('\\Dkd\\PhpCmis\\Bindings\\BindingSessionInterface')->setMethods(array('get'))->getMockForAbstractClass(); $httpInvokerClassName = '\\Dkd\\PhpCmis\\Test\\Fixtures\\Php\\HttpInvokerConstructorThrowsException'; $sessionMock->expects($this->exactly(2))->method('get')->will($this->returnValueMap(array(array(SessionParameter::HTTP_INVOKER_OBJECT, null, null), array(SessionParameter::HTTP_INVOKER_CLASS, null, $httpInvokerClassName)))); $this->setExpectedException('\\Dkd\\PhpCmis\\Exception\\CmisRuntimeException', sprintf('Could not create object of type "%s"!', $httpInvokerClassName)); $this->cmisBindingsHelper->getHttpInvoker($sessionMock); }
/** * Get a HTTP Invoker instance * * @return \GuzzleHttp\Client */ protected function getHttpInvoker() { /** @var \GuzzleHttp\Client $invoker */ $invoker = $this->cmisBindingsHelper->getHttpInvoker($this->getSession()); return $invoker; }