GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( 6a0f46...ee4e74 )
by Matthias
03:03
created

ShortcodeExtensionTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A resolve_placeholder_shortcode_in_twig() 0 3 1
A renderTemplate() 0 10 1
A filter_returns_safe_html() 0 3 1
1
<?php
2
3
namespace Webfactory\ShortcodeBundle\Tests\Functional;
4
5
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
6
7
/**
8
 * Test that integration with Twig works as expected.
9
 */
10
class ShortcodeExtensionTest extends KernelTestCase
11
{
12
    /**
13
     * @test
14
     */
15
    public function resolve_placeholder_shortcode_in_twig(): void
16
    {
17
        self::assertSame('News from year 1970.', $this->renderTemplate('{% apply shortcodes %}[placeholder year=1970]News from year %year%.[/placeholder]{% endapply %}'));
18
    }
19
20
    /**
21
     * @test
22
     */
23
    public function filter_returns_safe_html(): void
24
    {
25
        self::assertSame('<p>HTML</p>', $this->renderTemplate('{{ "<p>HTML</p>" | shortcodes }}'));
26
    }
27
28
    private function renderTemplate(string $template): string
29
    {
30
        self::bootKernel();
31
        $container = static::$container;
32
33
        $twig = $container->get('twig');
34
35
        $template = $twig->createTemplate($template);
36
37
        return $twig->render($template);
38
    }
39
}
40