public function setUp() { parent::setUp(); $conn = $this->getConnection(); $this->loadFixtures($conn); $this->transport = $this->getClient($conn); $this->transport->createWorkspace('default'); $this->repository = new \Jackalope\Repository(null, $this->transport); try { $this->transport->createWorkspace($GLOBALS['phpcr.workspace']); } catch (\PHPCR\RepositoryException $e) { if ($e->getMessage() != "Workspace '" . $GLOBALS['phpcr.workspace'] . "' already exists") { // if the message is not that the workspace already exists, something went really wrong throw $e; } } $this->session = $this->repository->login(new \PHPCR\SimpleCredentials("user", "passwd"), $GLOBALS['phpcr.workspace']); }
public function testUuid() { $class = new \ReflectionClass('Jackalope\\Transport\\DoctrineDBAL\\Client'); $method = $class->getMethod('generateUuid'); $method->setAccessible(true); $this->assertInternalType('string', $method->invoke($this->transport)); $this->transport->setUuidGenerator(function () { return 'like-a-uuid'; }); $this->assertEquals('like-a-uuid', $method->invoke($this->transport)); }
/** * {@inheritDoc} */ public function setTransactionTimeout($seconds) { return $this->transport->setTransactionTimeout($seconds); }
/** * {@inheritDoc} */ public function rollbackTransaction() { parent::rollbackTransaction(); $this->clearCaches(array_keys($this->caches)); }
/** * {@inheritDoc} */ public function rollbackTransaction() { parent::rollbackTransaction(); $this->caches['meta']->deleteAll(); if (isset($this->caches['nodes'])) { $this->caches['nodes']->deleteAll(); } }