eZ\Publish\Core\Persistence\Cache\Tests\SectionHandlerTest::testCreate PHP Method

testCreate() public method

public testCreate ( )
    public function testCreate()
    {
        $this->loggerMock->expects($this->once())->method('logCall');
        $innerHandlerMock = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\Section\\Handler');
        $this->persistenceHandlerMock->expects($this->once())->method('sectionHandler')->will($this->returnValue($innerHandlerMock));
        $innerHandlerMock->expects($this->once())->method('create')->with('Intranet', 'intranet')->will($this->returnValue(new SPISection(array('id' => 33, 'name' => 'Intranet', 'identifier' => 'intranet'))));
        $cacheItemMock = $this->getMock('Stash\\Interfaces\\ItemInterface');
        $this->cacheMock->expects($this->once())->method('getItem')->with('section', 33)->will($this->returnValue($cacheItemMock));
        $cacheItemMock->expects($this->once())->method('set')->with($this->isInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\Section'))->will($this->returnValue($cacheItemMock));
        $cacheItemMock->expects($this->once())->method('save')->with();
        $cacheItemMock->expects($this->never())->method('get');
        $handler = $this->persistenceCacheHandler->sectionHandler();
        $handler->create('Intranet', 'intranet');
    }