diff --git a/composer.json b/composer.json index 63882ab..a32559b 100644 --- a/composer.json +++ b/composer.json @@ -1,18 +1,18 @@ { - "name": "drupal/twig_tweak", - "type": "drupal-module", - "description": "A Twig extension with some useful functions and filters for Drupal development.", - "keywords": ["Drupal", "Twig"], - "license": "GPL-2.0+", - "homepage": "https://www.drupal.org/project/twig_tweak", - "support": { - "issues": "https://www.drupal.org/project/issues/twig_tweak", - "source": "https://git.drupalcode.org/project/twig_tweak" - }, - "require": { - "drupal/core": "^8.7 || ^9.0" - }, - "suggest": { - "symfony/var-dumper": "Better dump() function for debugging Twig variables" - } + "name": "drupal/twig_tweak", + "type": "drupal-module", + "description": "A Twig extension with some useful functions and filters for Drupal development.", + "keywords": ["Drupal", "Twig"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/twig_tweak", + "support": { + "issues": "https://www.drupal.org/project/issues/twig_tweak", + "source": "https://git.drupalcode.org/project/twig_tweak" + }, + "require": { + "drupal/core": "^8.7 || ^9.0" + }, + "suggest": { + "symfony/var-dumper": "Better dump() function for debugging Twig variables" + } } diff --git a/src/TwigExtension.php b/src/TwigExtension.php index d2a0d0f..5001459 100644 --- a/src/TwigExtension.php +++ b/src/TwigExtension.php @@ -283,7 +283,7 @@ class TwigExtension extends \Twig_Extension { // // @code // {{ 'Привет!'|transliterate }} - // @endcod + // @endcode new \Twig_SimpleFilter('transliterate', [$this, 'transliterate']), // - Check Markup - diff --git a/tests/src/Functional/TwigTweakTest.php b/tests/src/Functional/TwigTweakTest.php index 553f3d9..0bedf48 100644 --- a/tests/src/Functional/TwigTweakTest.php +++ b/tests/src/Functional/TwigTweakTest.php @@ -181,7 +181,9 @@ class TwigTweakTest extends BrowserTestBase { // Grant require permissions and test the forms again. $permissions = ['create page content', 'edit any page content']; - $this->grantPermissions(Role::load(Role::ANONYMOUS_ID), $permissions); + /** @var \Drupal\user\RoleInterface $role */ + $role = Role::load(Role::ANONYMOUS_ID); + $this->grantPermissions($role, $permissions); $this->drupalGet('/node/2'); // -- Test entity add form. @@ -295,7 +297,9 @@ class TwigTweakTest extends BrowserTestBase { $xpath = '//div[@class="tt-contextual-links" and not(div[@data-contextual-id])]'; $this->assertByXpath($xpath); - $this->grantPermissions(Role::load(Role::ANONYMOUS_ID), ['access contextual links']); + /** @var \Drupal\user\RoleInterface $role */ + $role = Role::load(Role::ANONYMOUS_ID); + $this->grantPermissions($role, ['access contextual links']); $this->drupalGet($this->getUrl()); $xpath = '//div[@class="tt-contextual-links" and div[@data-contextual-id]]'; $this->assertByXpath($xpath); diff --git a/tests/src/Kernel/AccessTest.php b/tests/src/Kernel/AccessTest.php index 9c56c59..d77c3c9 100644 --- a/tests/src/Kernel/AccessTest.php +++ b/tests/src/Kernel/AccessTest.php @@ -478,13 +478,6 @@ class AccessTest extends KernelTestBase { // -- Private image with access check. $build = $this->twigExtension->drupalImage('private://sea.jpg'); - $expected_build = [ - '#cache' => [ - 'contexts' => ['user'], - 'tags' => ['tag_for_private://sea.jpg'], - 'max-age' => 123, - ], - ]; self::assertNull($build); // -- Private image without access check.