eZ\Publish\Core\Persistence\Legacy\Tests\Content\MapperTest::testConvertToStorageValue PHP Method

testConvertToStorageValue() public method

    public function testConvertToStorageValue()
    {
        $convMock = $this->getMock('eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\FieldValue\\Converter');
        $convMock->expects($this->once())->method('toStorageValue')->with($this->isInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\FieldValue'), $this->isInstanceOf('eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\StorageFieldValue'))->will($this->returnValue(new StorageFieldValue()));
        $reg = new Registry(array('some-type' => $convMock));
        $field = new Field();
        $field->type = 'some-type';
        $field->value = new FieldValue();
        $mapper = new Mapper($reg, $this->getLanguageHandler());
        $res = $mapper->convertToStorageValue($field);
        $this->assertInstanceOf('eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\StorageFieldValue', $res);
    }