コード例 #1
0
 public function testGetJsonConverterThrowsExceptionIfGivenJsonConverterClassCouldNotBeInstantiated()
 {
     /** @var \Dkd\PhpCmis\Bindings\BindingSessionInterface|\PHPUnit_Framework_MockObject_MockObject $sessionMock */
     $sessionMock = $this->getMockBuilder('\\Dkd\\PhpCmis\\Bindings\\BindingSessionInterface')->setMethods(array('get'))->getMockForAbstractClass();
     $jsonConverterClassName = '\\Dkd\\PhpCmis\\Test\\Fixtures\\Php\\ConstructorThrowsException';
     $sessionMock->expects($this->exactly(2))->method('get')->will($this->returnValueMap(array(array(SessionParameter::JSON_CONVERTER, null, null), array(SessionParameter::JSON_CONVERTER_CLASS, null, $jsonConverterClassName))));
     $this->setExpectedException('\\Dkd\\PhpCmis\\Exception\\CmisRuntimeException', sprintf('Could not create object of type "%s"!', $jsonConverterClassName));
     $this->cmisBindingsHelper->getJsonConverter($sessionMock);
 }
コード例 #2
0
 /**
  * @param array $parameters
  * @param ObjectFactoryInterface|null $objectFactory
  * @param Cache|null $cache
  * @param Cache|null $typeDefinitionCache
  * @return Data\RepositoryInfoInterface[]
  */
 public function getRepositories(array $parameters, ObjectFactoryInterface $objectFactory = null, Cache $cache = null, Cache $typeDefinitionCache = null)
 {
     $cmisBindingsHelper = new CmisBindingsHelper();
     $binding = $cmisBindingsHelper->createBinding($parameters, $typeDefinitionCache);
     return $binding->getRepositoryService()->getRepositoryInfos();
 }
コード例 #3
0
 /**
  * Returns JSON Converter instance
  *
  * @return \Dkd\PhpCmis\Converter\JsonConverter
  */
 protected function getJsonConverter()
 {
     return $this->cmisBindingsHelper->getJsonConverter($this->getSession());
 }