class NodeTranslationRedirectTest
Same name in this branch
- 9 core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d6\NodeTranslationRedirectTest
Same name and namespace in other branches
- 11.x core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d6\NodeTranslationRedirectTest
- 11.x core/modules/node/tests/src/Kernel/Migrate/d7/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d7\NodeTranslationRedirectTest
Tests node translation redirections.
@group migrate_drupal @group node
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\node\Kernel\Migrate\d7\NodeTranslationRedirectTest uses \Drupal\Tests\user\Traits\UserCreationTrait implements \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of NodeTranslationRedirectTest
File
-
core/
modules/ node/ tests/ src/ Kernel/ Migrate/ d7/ NodeTranslationRedirectTest.php, line 15
Namespace
Drupal\Tests\node\Kernel\Migrate\d7View source
class NodeTranslationRedirectTest extends MigrateDrupal7TestBase {
use UserCreationTrait;
/**
* {@inheritdoc}
*/
protected static $modules = [
'content_translation',
'language',
'menu_ui',
'node',
'text',
'user',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->setUpCurrentUser();
$this->installSchema('node', [
'node_access',
]);
$this->migrateUsers(FALSE);
$this->migrateContentTypes();
$this->executeMigrations([
'language',
'd7_language_types',
'd7_language_negotiation_settings',
'd7_node',
'd7_node_translation',
]);
}
/**
* Tests that not found node translations are redirected.
*/
public function testNodeTranslationRedirect() {
$kernel = $this->container
->get('http_kernel');
$request = Request::create('/node/3');
$response = $kernel->handle($request);
$this->assertSame(301, $response->getStatusCode());
$this->assertSame('/node/2', $response->getTargetUrl());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.