eZ\Publish\Core\FieldType\Tests\Url\Gateway\LegacyStorageTest::testLinkUrl PHP Method

testLinkUrl() public method

public testLinkUrl ( )
    public function testLinkUrl()
    {
        $gateway = $this->getStorageGateway();
        $urlId = 12;
        $fieldId = 10;
        $versionNo = 1;
        $gateway->linkUrl($urlId, $fieldId, $versionNo);
        $query = $this->getDatabaseHandler()->createSelectQuery();
        $query->select('*')->from('ezurl_object_link')->where($query->expr->eq($this->handler->quoteColumn('url_id'), $query->bindValue($urlId)));
        $statement = $query->prepare();
        $statement->execute();
        $result = $statement->fetchAll(\PDO::FETCH_ASSOC);
        $expected = array(array('contentobject_attribute_id' => $fieldId, 'contentobject_attribute_version' => $versionNo, 'url_id' => $urlId));
        $this->assertEquals($expected, $result);
    }