public function NodeTranslationRedirectTest::testNodeTranslationRedirect in Drupal 8
Same name in this branch
- 8 core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d6\NodeTranslationRedirectTest::testNodeTranslationRedirect()
- 8 core/modules/node/tests/src/Kernel/Migrate/d7/NodeTranslationRedirectTest.php \Drupal\Tests\node\Kernel\Migrate\d7\NodeTranslationRedirectTest::testNodeTranslationRedirect()
Same name and namespace in other branches
- 9 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/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 56
Class
- NodeTranslationRedirectTest
- Tests node translation redirections.
Namespace
Drupal\Tests\node\Kernel\Migrate\d7Code
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());
}