eZ\Publish\Core\Persistence\Legacy\Tests\Content\UrlAliasHandlerTest::testLocationDeleted PHP Метод

testLocationDeleted() публичный Метод

Test for the locationDeleted() method.
public testLocationDeleted ( )
    public function testLocationDeleted()
    {
        $handler = $this->getHandler();
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_location_delete.php');
        $countBeforeDeleting = $this->countRows();
        $handler->locationDeleted(5);
        self::assertEquals($countBeforeDeleting - 5, $this->countRows());
        self::assertEmpty($handler->listURLAliasesForLocation(5));
        $removedAliases = array('moved-original-parent/moved-history', 'moved-original-parent/sub', 'moved-original-parent', 'moved-original-parent-history', 'custom-below/moved-original-parent-custom');
        foreach ($removedAliases as $path) {
            try {
                $handler->lookup($path);
                $this->fail("Alias '{$path}' not removed!");
            } catch (NotFoundException $e) {
                // Do nothing
            }
        }
    }
UrlAliasHandlerTest