function NodeTranslationRedirectTest::testNodeTranslationRedirect
Same name in this branch
- 11.x core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d6\NodeTranslationRedirectTest::testNodeTranslationRedirect()
Same name in other branches
- 9 core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d6\NodeTranslationRedirectTest::testNodeTranslationRedirect()
- 9 core/modules/node/tests/src/Kernel/Migrate/d7/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d7\NodeTranslationRedirectTest::testNodeTranslationRedirect()
- 8.9.x core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d6\NodeTranslationRedirectTest::testNodeTranslationRedirect()
- 8.9.x core/modules/node/tests/src/Kernel/Migrate/d7/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d7\NodeTranslationRedirectTest::testNodeTranslationRedirect()
- 10 core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d6\NodeTranslationRedirectTest::testNodeTranslationRedirect()
- 10 core/modules/node/tests/src/Kernel/Migrate/d7/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d7\NodeTranslationRedirectTest::testNodeTranslationRedirect()
Tests that not found node translations are redirected.
File
-
core/
modules/ node/ tests/ src/ Kernel/ Migrate/ d7/ NodeTranslationRedirectTest.php, line 57
Class
- NodeTranslationRedirectTest
- Tests node translation redirects.
Namespace
Drupal\Tests\node\Kernel\Migrate\d7Code
public function testNodeTranslationRedirect() : void {
$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.