eZ\Publish\Core\Persistence\Legacy\Tests\Content\Location\Gateway\DoctrineDatabaseTest::testCreateLocationNodeAssignmentCreationMainLocation PHP Method

testCreateLocationNodeAssignmentCreationMainLocation() public method

    public function testCreateLocationNodeAssignmentCreationMainLocation()
    {
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
        $handler = $this->getLocationGateway();
        $handler->createNodeAssignment(new CreateStruct(array('contentId' => 68, 'contentVersion' => 1, 'mainLocationId' => true, 'priority' => 1, 'remoteId' => 'some_id', 'sortField' => 1, 'sortOrder' => 1)), '77', DoctrineDatabase::NODE_ASSIGNMENT_OP_CODE_CREATE);
        $query = $this->handler->createSelectQuery();
        $this->assertQueryResult(array(array(1)), $query->select('is_main')->from('eznode_assignment')->where($query->expr->lAnd($query->expr->eq('contentobject_id', 68), $query->expr->eq('parent_node', 77))));
    }