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

testUpdateField() public method

public testUpdateField ( )
    public function testUpdateField()
    {
        $content = $this->getContentFixture();
        $content->versionInfo->contentInfo->id = 2342;
        $field = $this->getFieldFixture();
        $value = $this->getStorageValueFixture();
        $gateway = $this->getDatabaseGateway();
        $field->id = $gateway->insertNewField($content, $field, $value);
        $newValue = new StorageFieldValue(array('dataFloat' => 124.42, 'dataInt' => 142, 'dataText' => 'New text', 'sortKeyInt' => 123, 'sortKeyString' => 'new_text'));
        $gateway->updateField($field, $newValue);
        $this->assertQueryResult(array(array('data_float' => '124.42', 'data_int' => '142', 'data_text' => 'New text', 'sort_key_int' => '123', 'sort_key_string' => 'new_text')), $this->getDatabaseHandler()->createSelectQuery()->select(array('data_float', 'data_int', 'data_text', 'sort_key_int', 'sort_key_string'))->from('ezcontentobject_attribute'));
    }
DoctrineDatabaseTest