Browse Source

Fix code style issues

merge-requests/4/head 8.x-2.5
Chi 5 years ago
parent
commit
8748966d52
  1. 2
      src/TwigExtension.php
  2. 8
      tests/src/Functional/TwigTweakTest.php
  3. 7
      tests/src/Kernel/AccessTest.php

2
src/TwigExtension.php

@ -283,7 +283,7 @@ class TwigExtension extends \Twig_Extension {
//
// @code
// {{ 'Привет!'|transliterate }}
// @endcod
// @endcode
new \Twig_SimpleFilter('transliterate', [$this, 'transliterate']),
// - Check Markup -

8
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);

7
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.

Loading…
Cancel
Save