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

ShortcodeDefinitionTestHelperTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 57
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A can_test_whether_shortcode_is_defined() 0 4 1
A throws_exception_for_handlers_that_do_not_use_controllers() 0 4 1
A can_retrieve_handler() 0 3 1
A throws_exception_for_shortcode_with_unresolvable_controller() 0 4 1
A setUp() 0 4 1
A can_be_used_to_assert_controller_class_and_method() 0 6 1
1
<?php
2
3
namespace Webfactory\ShortcodeBundle\Tests\Functional;
4
5
use InvalidArgumentException;
6
use RuntimeException;
7
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
8
use Thunder\Shortcode\Handler\PlaceholderHandler;
9
use Webfactory\ShortcodeBundle\Test\ShortcodeDefinitionTestHelper;
10
use Webfactory\ShortcodeBundle\Tests\Fixtures\Controller\ShortcodeTestController;
11
12
class ShortcodeDefinitionTestHelperTest extends KernelTestCase
13
{
14
    /**
15
     * @var ShortcodeDefinitionTestHelper
16
     */
17
    private $helper;
18
19
    protected function setUp(): void
20
    {
21
        self::bootKernel();
22
        $this->helper = static::$container->get(ShortcodeDefinitionTestHelper::class);
23
    }
24
25
    /**
26
     * @test
27
     */
28
    public function throws_exception_for_handlers_that_do_not_use_controllers(): void
29
    {
30
        self::expectException(RuntimeException::class);
0 ignored issues
show
Bug Best Practice introduced by
The method PHPUnit\Framework\TestCase::expectException() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
        self::/** @scrutinizer ignore-call */ 
31
              expectException(RuntimeException::class);
Loading history...
31
        $this->helper->resolveShortcodeController('placeholder'); // uses the \Thunder\Shortcode\Handler\PlaceholderHandler handler class directly
32
    }
33
34
    /**
35
     * @test
36
     */
37
    public function throws_exception_for_shortcode_with_unresolvable_controller(): void
38
    {
39
        self::expectException(InvalidArgumentException::class);
0 ignored issues
show
Bug Best Practice introduced by
The method PHPUnit\Framework\TestCase::expectException() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

39
        self::/** @scrutinizer ignore-call */ 
40
              expectException(InvalidArgumentException::class);
Loading history...
40
        $this->helper->resolveShortcodeController('test-config-invalid-controller');
41
    }
42
43
    /**
44
     * @test
45
     */
46
    public function can_test_whether_shortcode_is_defined(): void
47
    {
48
        self::assertTrue($this->helper->hasShortcode('placeholder'));
49
        self::assertFalse($this->helper->hasShortcode('unknown-shortcode'));
50
    }
51
52
    /**
53
     * @test
54
     */
55
    public function can_retrieve_handler(): void
56
    {
57
        self::assertInstanceOf(PlaceholderHandler::class, $this->helper->getHandler('placeholder'));
58
    }
59
60
    /**
61
     * @test
62
     */
63
    public function can_be_used_to_assert_controller_class_and_method(): void
64
    {
65
        $controller = $this->helper->resolveShortcodeController('test-config-inline');
66
67
        self::assertInstanceOf(ShortcodeTestController::class, $controller[0]);
68
        self::assertSame('test', $controller[1]);
69
    }
70
}
71