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

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

Test for the locationSwapped() method.
    public function testLocationSwappedSimpleWithHistory()
    {
        $handler = $this->getHandler();
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_simple_history.php');
        $countBeforeReusing = $this->countRows();
        $handler->locationSwapped(316, 314, 317, 315);
        $this->assertEquals($countBeforeReusing, $this->countRows());
        $urlAlias = $handler->lookup('jedan/swap');
        $this->assertEquals(new UrlAlias(array('id' => '2-' . md5('swap'), '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'))), 'alwaysAvailable' => false, 'isHistory' => true, 'isCustom' => false, 'forward' => false)), $urlAlias);
        $urlAlias = $handler->lookup('dva/swap');
        $this->assertEquals(new UrlAlias(array('id' => '3-' . md5('swap'), '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'))), 'alwaysAvailable' => false, 'isHistory' => true, 'isCustom' => false, 'forward' => false)), $urlAlias);
        $urlAlias = $handler->lookup('jedan/swap-new');
        $this->assertEquals(new UrlAlias(array('id' => '2-' . md5('swap-new'), '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-new'))), 'alwaysAvailable' => false, 'isHistory' => false, 'isCustom' => false, 'forward' => false)), $urlAlias);
        $urlAlias = $handler->lookup('dva/swap-new');
        $this->assertEquals(new UrlAlias(array('id' => '3-' . md5('swap-new'), '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-new'))), 'alwaysAvailable' => false, 'isHistory' => false, 'isCustom' => false, 'forward' => false)), $urlAlias);
    }
UrlAliasHandlerTest