eZ\Publish\Core\Helper\Tests\ContentInfoLocationLoader\SudoMainLocationLoaderTest::testLoadLocationError PHP Method

testLoadLocationError() public method

    public function testLoadLocationError()
    {
        $contentInfo = new ContentInfo(['mainLocationId' => 42]);
        $location = new Location();
        $this->getRepositoryMock()->expects($this->any())->method('getPermissionResolver')->will($this->returnValue($this->getPermissionResolverMock()));
        $this->getRepositoryMock()->expects($this->any())->method('getLocationService')->will($this->returnValue($this->getLocationServiceMock()));
        $this->getLocationServiceMock()->expects($this->once())->method('loadLocation')->with(42)->will($this->throwException(new NotFoundException('main location of content', 42)));
        $this->assertSame($location, $this->loader->loadLocation($contentInfo));
    }