eZ\Publish\Core\Persistence\Cache\Tests\ContentTypeHandlerTest::testAddFieldDefinition PHP Method

testAddFieldDefinition() public method

    public function testAddFieldDefinition()
    {
        $this->loggerMock->expects($this->once())->method('logCall');
        $this->cacheMock->expects($this->at(0))->method('clear')->with('contentType', 44)->will($this->returnValue(true));
        $this->cacheMock->expects($this->at(1))->method('clear')->with('searchableFieldMap')->will($this->returnValue(true));
        $innerHandlerMock = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\Type\\Handler');
        $this->persistenceHandlerMock->expects($this->once())->method('contentTypeHandler')->will($this->returnValue($innerHandlerMock));
        $innerHandlerMock->expects($this->once())->method('addFieldDefinition')->with(44, SPIType::STATUS_DEFINED, $this->isInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\Type\\FieldDefinition'))->will($this->returnValue(true));
        $handler = $this->persistenceCacheHandler->contentTypeHandler();
        $handler->addFieldDefinition(44, SPIType::STATUS_DEFINED, new SPITypeFieldDefinition());
    }