Completed
Push — master ( b28dd3...cc924e )
by Robbie
03:15
created

ChecIOShortcodeTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testBuyNowButton() 0 7 1
1
<?php
2
3
class ChecIOShortcodeTest extends FunctionalTest
0 ignored issues
show
Bug introduced by
The type FunctionalTest was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
4
{
5
    protected static $fixture_file = 'ChecIOShortcodeTest.yml';
6
7
    /**
8
     * @var Page
0 ignored issues
show
Bug introduced by
The type Page was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
     */
10
    private $page;
11
12
    public function setUp()
13
    {
14
        parent::setUp();
15
        $this->page = $this->objFromFixture('SiteTree', 'test');
16
    }
17
18
    /**
19
     * Tests that the shortcode gets parsed
20
     */
21
    public function testBuyNowButton()
22
    {
23
        $text = $this->page->Content;
24
        $parsed = ShortcodeParser::get_active()->parse($text);
0 ignored issues
show
Bug introduced by
The type ShortcodeParser was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
        $this->assertContains(
26
            '<a href="https://checkout.chec.io/1">Buy Now</a>',
27
            $parsed
28
        );
29
    }
30
}
31