eZ\Publish\Core\REST\Common\Tests\Input\FieldTypeParserTest::testParseFieldSettingsWithPreProcessing PHP Метод

testParseFieldSettingsWithPreProcessing() публичный Метод

    public function testParseFieldSettingsWithPreProcessing()
    {
        $fieldTypeParser = $this->getFieldTypeParser();
        $this->fieldTypeProcessorRegistryMock->expects($this->once())->method('hasProcessor')->with($this->equalTo('some-fancy-field-type'))->will($this->returnValue(true));
        $processor = $this->fieldTypeProcessorMock;
        $this->fieldTypeProcessorRegistryMock->expects($this->once())->method('getProcessor')->with($this->equalTo('some-fancy-field-type'))->will($this->returnCallback(function () use($processor) {
            return $processor;
        }));
        $processor->expects($this->once())->method('preProcessFieldSettingsHash')->with(array(1, 2, 3))->will($this->returnValue(array(4, 5, 6)));
        $fieldTypeMock = $this->fieldTypeMock;
        $this->fieldTypeServiceMock->expects($this->once())->method('getFieldType')->with($this->equalTo('some-fancy-field-type'))->will($this->returnCallback(function () use($fieldTypeMock) {
            return $fieldTypeMock;
        }));
        $fieldTypeMock->expects($this->once())->method('fieldSettingsFromHash')->with($this->equalTo(array(4, 5, 6)))->will($this->returnValue(array('foo', 'bar')));
        $this->assertEquals(array('foo', 'bar'), $fieldTypeParser->parseFieldSettings('some-fancy-field-type', array(1, 2, 3)));
    }