Completed
Push — master ( 64491b...1f7f5f )
by Jan-Petter
30:57
created

NoneTest::testNone()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 9
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 9
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 3
1
<?php
2
3
namespace vipnytt\XRobotsTagParser\Tests;
4
5
use vipnytt\XRobotsTagParser;
6
7 View Code Duplication
class NoneTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    /**
10
     * none test
11
     *
12
     * @dataProvider generateDataForTest
13
     * @param string $url
14
     * @param string $bot
15
     * @param array $options
16
     */
17
    public function testNone($url, $bot, $options)
18
    {
19
        $parser = new XRobotsTagParser($url, $bot, $options);
20
        $this->assertInstanceOf('vipnytt\XRobotsTagParser', $parser);
21
22
        $this->assertTrue($parser->getRules(true)['none']);
23
        $this->assertTrue($parser->getRules(false)['noindex']);
24
        $this->assertTrue($parser->getRules(false)['nofollow']);
25
    }
26
27
    /**
28
     * Generate test data
29
     * @return array
30
     */
31
    public function generateDataForTest()
32
    {
33
        return [
34
            [
35
                'http://example.com/',
36
                'googlebot',
37
                ['headers' =>
38
                    [
39
                        'X-Robots-Tag: none'
40
                    ]
41
                ]
42
            ]
43
        ];
44
    }
45
}
46