3 namespace Drupal\Tests\node\Kernel\Migrate\d6;
5 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
6 use Symfony\Component\HttpFoundation\Request;
9 * Tests node translation redirections.
11 * @group migrate_drupal
14 class NodeTranslationRedirectTest extends MigrateDrupal6TestBase {
19 public static $modules = [
20 'content_translation',
23 // Required for translation migrations.
24 'migrate_drupal_multilingual',
30 protected function setUp() {
33 $this->installEntitySchema('node');
34 $this->installConfig(['node']);
35 $this->installSchema('node', ['node_access']);
36 $this->installSchema('system', ['key_value']);
37 $this->migrateUsers(FALSE);
38 $this->migrateFields();
40 $this->executeMigrations([
43 'd6_language_negotiation_settings',
46 'd6_node_translation',
51 * Tests that not found node translations are redirected.
53 public function testNodeTranslationRedirect() {
54 $kernel = $this->container->get('http_kernel');
55 $request = Request::create('/node/11');
56 $response = $kernel->handle($request);
57 $this->assertSame(301, $response->getStatusCode());
58 $this->assertSame('/node/10', $response->getTargetUrl());