public function testGetPreviewLocation()
{
$contentId = 123;
$locationId = 456;
$contentInfo = $this->getMockBuilder('eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo')->setConstructorArgs(array(array('id' => $contentId, 'mainLocationId' => $locationId)))->getMockForAbstractClass();
$location = $this->getMockBuilder('eZ\\Publish\\Core\\Repository\\Values\\Content\\Location')->setConstructorArgs(array(array('id' => $locationId, 'contentInfo' => $contentInfo)))->getMockForAbstractClass();
$this->contentService->expects($this->once())->method('loadContentInfo')->with($contentId)->will($this->returnValue($contentInfo));
$this->locationService->expects($this->once())->method('loadLocation')->with($locationId)->will($this->returnValue($location));
$this->locationHandler->expects($this->never())->method('loadParentLocationsForDraftContent');
$returnedLocation = $this->provider->loadMainLocation($contentId);
$this->assertSame($location, $returnedLocation);
$this->assertSame($contentInfo, $returnedLocation->contentInfo);
}