public function testDeleteContentWithLocations() { $handlerMock = $this->getPartlyMockedHandler(array('getAllLocationIds')); $gatewayMock = $this->getGatewayMock(); $treeHandlerMock = $this->getTreeHandlerMock(); $gatewayMock->expects($this->once())->method('getAllLocationIds')->with($this->equalTo(23))->will($this->returnValue(array(42, 24))); $treeHandlerMock->expects($this->exactly(2))->method('removeSubtree')->with($this->logicalOr($this->equalTo(42), $this->equalTo(24))); $handlerMock->deleteContent(23); }