public function testRemoveRawContent() { $treeHandler = $this->getPartlyMockedTreeHandler(array('loadContentInfo', 'listVersions')); $treeHandler->expects($this->once())->method('listVersions')->will($this->returnValue(array(new VersionInfo(), new VersionInfo()))); $treeHandler->expects($this->once())->method('loadContentInfo')->with(23)->will($this->returnValue(new ContentInfo(array('mainLocationId' => 42)))); $this->getFieldHandlerMock()->expects($this->exactly(2))->method('deleteFields')->with($this->equalTo(23), $this->isInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\VersionInfo')); $this->getContentGatewayMock()->expects($this->once())->method('deleteRelations')->with($this->equalTo(23)); $this->getContentGatewayMock()->expects($this->once())->method('deleteVersions')->with($this->equalTo(23)); $this->getContentGatewayMock()->expects($this->once())->method('deleteNames')->with($this->equalTo(23)); $this->getContentGatewayMock()->expects($this->once())->method('deleteContent')->with($this->equalTo(23)); $this->getLocationGatewayMock()->expects($this->once())->method('removeElementFromTrash')->with($this->equalTo(42)); $treeHandler->removeRawContent(23); }