Пример #1
0
 public function setUp()
 {
     parent::setUp();
     $conn = $this->getConnection();
     $options = array('disable_fks' => $conn->getDatabasePlatform() instanceof SqlitePlatform);
     $schema = new RepositorySchema($options, $conn);
     // do not use reset as we want to ignore exceptions on drop
     foreach ($schema->toDropSql($conn->getDatabasePlatform()) as $statement) {
         try {
             $conn->exec($statement);
         } catch (\Exception $e) {
             // ignore
         }
     }
     foreach ($schema->toSql($conn->getDatabasePlatform()) as $statement) {
         $conn->exec($statement);
     }
     $this->transport = new \Jackalope\Transport\DoctrineDBAL\Client(new \Jackalope\Factory(), $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 setUp()
 {
     parent::setUp();
     $conn = $this->getConnection();
     $this->nodeTypeManager = $this->getMock('Jackalope\\NodeType\\NodeTypeManager', array(), array(), '', false);
     $this->nodeTypeManager->expects($this->any())->method('hasNodeType')->will($this->returnValue(true));
     $this->factory = new QueryObjectModelFactory(new Factory());
     $this->walker = new QOMWalker($this->nodeTypeManager, $conn);
     $this->defaultColumns = 'n0.path AS n0_path, n0.identifier AS n0_identifier, n0.props AS n0_props';
 }
Пример #3
0
 public function setUp()
 {
     parent::setUp();
     $conn = $this->getConnection();
     $this->nodeTypeManager = $this->getMock('Jackalope\\NodeType\\NodeTypeManager', array(), array(), '', false);
     $this->nodeTypeManager->expects($this->any())->method('hasNodeType')->will($this->returnValue(true));
     $this->factory = new QueryObjectModelFactory(new Factory());
     $this->walker = new QOMWalker($this->nodeTypeManager, $conn);
     $this->defaultColumns = 'n0.id AS n0_id, n0.path AS n0_path, n0.parent AS n0_parent, n0.local_name AS n0_local_name, n0.namespace AS n0_namespace, n0.workspace_name AS n0_workspace_name, n0.identifier AS n0_identifier, n0.type AS n0_type, n0.props AS n0_props, n0.depth AS n0_depth, n0.sort_order AS n0_sort_order';
 }
 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']);
 }