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.

SyntaxTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 5
dl 0
loc 43
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testSyntax() 0 8 1
A provideSyntaxes() 0 8 1
A testBuilder() 0 15 1
1
<?php
2
namespace Thunder\Shortcode\Tests;
3
4
use Thunder\Shortcode\Syntax\Syntax;
5
use Thunder\Shortcode\Syntax\CommonSyntax;
6
use Thunder\Shortcode\Syntax\SyntaxBuilder;
7
use Thunder\Shortcode\Syntax\SyntaxInterface;
8
9
/**
10
 * @author Tomasz Kowalczyk <[email protected]>
11
 */
12
final class SyntaxTest extends AbstractTestCase
13
{
14
    /**
15
     * @dataProvider provideSyntaxes
16
     */
17
    public function testSyntax(SyntaxInterface $syntax, $open, $close, $slash, $parameter, $value)
18
    {
19
        static::assertSame($open, $syntax->getOpeningTag());
20
        static::assertSame($close, $syntax->getClosingTag());
21
        static::assertSame($slash, $syntax->getClosingTagMarker());
22
        static::assertSame($parameter, $syntax->getParameterValueSeparator());
23
        static::assertSame($value, $syntax->getParameterValueDelimiter());
24
    }
25
26
    public function provideSyntaxes()
27
    {
28
        return array(
29
            array(new Syntax(), '[', ']', '/', '=', '"'),
30
            array(new Syntax('[[', ']]', '//', '==', '""'), '[[', ']]', '//', '==', '""'),
31
            array(new CommonSyntax(), '[', ']', '/', '=', '"'),
32
        );
33
    }
34
35
    /**
36
     * Note: do not merge this test with data provider above, code coverage
37
     * does not understand this and marks builder class as untested.
38
     */
39
    public function testBuilder()
40
    {
41
        $builder = new SyntaxBuilder();
42
        $this->testSyntax($builder->getSyntax(), '[', ']', '/', '=', '"');
43
44
        $builder = new SyntaxBuilder();
45
        $doubleBuiltSyntax = $builder
46
            ->setOpeningTag('[[')
47
            ->setClosingTag(']]')
48
            ->setClosingTagMarker('//')
49
            ->setParameterValueSeparator('==')
50
            ->setParameterValueDelimiter('""')
51
            ->getSyntax();
52
        $this->testSyntax($doubleBuiltSyntax, '[[', ']]', '//', '==', '""');
53
    }
54
}
55