Completed
Pull Request — master (#16)
by Matthijs
08:37
created

FilterableUriTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 3
dl 0
loc 40
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 1
A testSetFiltered() 0 6 1
A testGetIdentifier() 0 4 1
1
<?php
2
namespace VDB\Spider\Tests\Uri;
3
4
use VDB\Spider\Tests\TestCase;
5
use VDB\Spider\Uri\FilterableUri;
6
use VDB\Uri\Uri;
7
8
/**
9
 *
10
 */
11
class FilterableUriTest extends TestCase
12
{
13
    /**
14
     * @var FilterableUri
15
     */
16
    protected $uri;
17
18
    /**
19
     * Sets up the fixture, for example, opens a network connection.
20
     * This method is called before a test is executed.
21
     */
22
    protected function setUp()
23
    {
24
        $this->uri = new FilterableUri(new Uri(
25
            '/domains/special',
26
            'http://example.org'
27
        ));
28
    }
29
30
    /**
31
     * @covers VDB\Spider\Uri\FilterableUri::setFiltered
32
     * @covers VDB\Spider\Uri\FilterableUri::isFiltered
33
     * @covers VDB\Spider\Uri\FilterableUri::getFilterReason
34
     */
35
    public function testSetFiltered()
36
    {
37
        $this->uri->setFiltered(true, 'goodReason');
38
        $this->assertTrue($this->uri->isFiltered());
39
        $this->assertEquals('goodReason', $this->uri->getFilterReason());
40
    }
41
42
    /**
43
     * @covers VDB\Spider\Uri\FilterableUri::getIdentifier
44
     * @todo   Implement testGetIdentifier().
45
     */
46
    public function testGetIdentifier()
47
    {
48
        $this->assertEquals('http://example.org/domains/special', $this->uri->getIdentifier());
49
    }
50
}
51