DeprecatedTemplateTest.php

Same filename and directory in other branches
  1. 10 core/modules/system/tests/src/Functional/Module/DeprecatedTemplateTest.php

Namespace

Drupal\Tests\system\Functional\Module

File

core/modules/system/tests/src/Functional/Module/DeprecatedTemplateTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\system\Functional\Module;

use Drupal\Tests\BrowserTestBase;

/**
 * Tests that the deprecated template is correctly marked.
 *
 * @group Theme
 */
class DeprecatedTemplateTest extends BrowserTestBase {
    
    /**
     * {@inheritdoc}
     */
    protected $defaultTheme = 'stark';
    
    /**
     * Modules to install.
     *
     * @var array
     */
    protected static $modules = [
        'deprecated_twig_template',
    ];
    
    /**
     * Tests that the deprecated template is marked as deprecated.
     *
     * @group legacy
     */
    public function testDeprecatedTemplate() : void {
        $this->expectDeprecation('The "deprecated-template.html.twig" template is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another template instead. See https://www.example.com');
        $this->drupalGet('/deprecated-twig-template');
    }

}

Classes

Title Deprecated Summary
DeprecatedTemplateTest Tests that the deprecated template is correctly marked.

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