function NodeTranslationRedirectTest::testNodeTranslationRedirect

Tests that not found node translations are redirected.

File

core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php, line 57

Class

NodeTranslationRedirectTest
Tests node translation redirects.

Namespace

Drupal\Tests\node\Kernel\Migrate\d6

Code

public function testNodeTranslationRedirect() : void {
  $kernel = $this->container
    ->get('http_kernel');
  $request = Request::create('/node/11');
  $response = $kernel->handle($request);
  $this->assertSame(301, $response->getStatusCode());
  $this->assertSame('/node/10', $response->getTargetUrl());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.