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

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

Test for the locationSwapped() method.
    public function testLocationSwappedWithReusingNopEntry()
    {
        $handler = $this->getHandler();
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_reusing_nop.php');
        $countBeforeReusing = $this->countRows();
        $handler->locationSwapped(316, 314, 317, 315);
        $this->assertEquals($countBeforeReusing + 1, $this->countRows());
        $urlAlias = $handler->lookup('jedan/swap-that');
        $this->assertEquals(new UrlAlias(array('id' => '2-' . md5('swap-that'), 'type' => UrlAlias::LOCATION, 'destination' => 316, 'languageCodes' => array('cro-HR'), 'pathData' => array(array('always-available' => false, 'translations' => array('cro-HR' => 'jedan')), array('always-available' => false, 'translations' => array('cro-HR' => 'swap-that'))), 'alwaysAvailable' => false, 'isHistory' => false, 'isCustom' => false, 'forward' => false)), $urlAlias);
        $urlAlias = $handler->lookup('dva/swap-this');
        $this->assertEquals(new UrlAlias(array('id' => '3-' . md5('swap-this'), 'type' => UrlAlias::LOCATION, 'destination' => 317, 'languageCodes' => array('cro-HR'), 'pathData' => array(array('always-available' => false, 'translations' => array('cro-HR' => 'dva')), array('always-available' => false, 'translations' => array('cro-HR' => 'swap-this'))), 'alwaysAvailable' => false, 'isHistory' => false, 'isCustom' => false, 'forward' => false)), $urlAlias);
        $urlAlias = $handler->lookup('dva/swap-that');
        $this->assertEquals(new UrlAlias(array('id' => '3-' . md5('swap-that'), 'type' => UrlAlias::LOCATION, 'destination' => 317, 'languageCodes' => array('cro-HR'), 'pathData' => array(array('always-available' => false, 'translations' => array('cro-HR' => 'dva')), array('always-available' => false, 'translations' => array('cro-HR' => 'swap-that'))), 'alwaysAvailable' => false, 'isHistory' => true, 'isCustom' => false, 'forward' => false)), $urlAlias);
        $urlAlias = $handler->lookup('jedan/swap-this');
        $this->assertEquals(new UrlAlias(array('id' => '2-' . md5('swap-this'), 'type' => UrlAlias::LOCATION, 'destination' => 316, 'languageCodes' => array('cro-HR'), 'pathData' => array(array('always-available' => false, 'translations' => array('cro-HR' => 'jedan')), array('always-available' => false, 'translations' => array('cro-HR' => 'swap-this'))), 'alwaysAvailable' => false, 'isHistory' => true, 'isCustom' => false, 'forward' => false)), $urlAlias);
    }
UrlAliasHandlerTest