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',
28 protected function setUp() {
31 $this->installEntitySchema('node');
32 $this->installConfig(['node']);
33 $this->installSchema('node', ['node_access']);
34 $this->installSchema('system', ['key_value']);
35 $this->migrateUsers(FALSE);
36 $this->migrateFields();
38 $this->executeMigrations([
41 'd6_language_negotiation_settings',
44 'd6_node_translation',
49 * Tests that not found node translations are redirected.
51 public function testNodeTranslationRedirect() {
52 $kernel = $this->container->get('http_kernel');
53 $request = Request::create('/node/11');
54 $response = $kernel->handle($request);
55 $this->assertSame(301, $response->getStatusCode());
56 $this->assertSame('/node/10', $response->getTargetUrl());