Jackalope\Transport\DoctrineDBAL\ClientTest::testMoveAndReplace PHP Method

testMoveAndReplace() public method

public testMoveAndReplace ( )
    public function testMoveAndReplace()
    {
        $root = $this->session->getNode('/');
        $topic1 = $root->addNode('topic1');
        $topic1->addNode('thisisanewnode');
        $topic1->addNode('topic1Child');
        $this->session->save();
        $this->session->move('/topic1', '/topic2');
        $root->addNode('topic1');
        $this->session->save();
        $conn = $this->getConnection();
        $qb = $conn->createQueryBuilder();
        $qb->select('local_name')->from('phpcr_nodes', 'n')->where('n.path = :path');
        $query = $qb->getSql();
        foreach (array('/topic1', '/topic2', '/topic2/thisisanewnode', '/topic2/topic1Child') as $path) {
            $stmnt = $this->conn->executeQuery($query, array('path' => $path));
            $row = $stmnt->fetch();
            $this->assertTrue(false !== $row, $path . ' does not exist in database');
        }
    }