public function FileLinkRedirectTest::testNotValidRedirect in File Link 8
Same name and namespace in other branches
- 2.0.x tests/src/Functional/FileLinkRedirectTest.php \Drupal\Tests\file_link\Functional\FileLinkRedirectTest::testNotValidRedirect()
Test not valid redirect.
Throws
\Drupal\Core\Entity\EntityStorageException
File
- tests/
src/ Functional/ FileLinkRedirectTest.php, line 64
Class
- FileLinkRedirectTest
- Provides functional tests for 'file_link' field type.
Namespace
Drupal\Tests\file_link\FunctionalCode
public function testNotValidRedirect() {
$entity = EntityTest::create([
'name' => 'Foo',
'type' => 'article',
]);
$entity
->set('url_without_extension', [
'uri' => Url::fromUri('base:/test/redirect/301/rst', [
'absolute' => TRUE,
])
->toString(),
]);
$violations = $entity
->get('url_without_extension')
->validate();
$this
->assertSame(1, $violations
->count());
}