eZ\Publish\Core\Persistence\Legacy\Tests\Content\Location\TrashHandlerTest::testTrashSubtreeReturnsNull PHP Method

testTrashSubtreeReturnsNull() public method

    public function testTrashSubtreeReturnsNull()
    {
        $handler = $this->getTrashHandler();
        $this->locationGateway->expects($this->at(0))->method('getSubtreeContent')->with(20)->will($this->returnValue(array(array('contentobject_id' => 10, 'node_id' => 20, 'main_node_id' => 30, 'parent_node_id' => 40), array('contentobject_id' => 11, 'node_id' => 21, 'main_node_id' => 31, 'parent_node_id' => 41))));
        $this->locationGateway->expects($this->at(1))->method('countLocationsByContentId')->with(10)->will($this->returnValue(2));
        $this->locationGateway->expects($this->at(2))->method('removeLocation')->with(20);
        $this->locationGateway->expects($this->at(3))->method('countLocationsByContentId')->with(11)->will($this->returnValue(1));
        $this->locationGateway->expects($this->at(4))->method('trashLocation')->with(21);
        $this->locationHandler->expects($this->once())->method('markSubtreeModified')->with(40);
        $returnValue = $handler->trashSubtree(20);
        self::assertNull($returnValue);
    }