Passed
Branch feature/cleanup (2bd333)
by Matthijs
06:03
created

FilterableUriTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
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
7
/**
8
 *
9
 */
10
class FilterableUriTest extends TestCase
11
{
12
    /**
13
     * @var FilterableUri
14
     */
15
    protected $uri;
16
17
    /**
18
     * Sets up the fixture, for example, opens a network connection.
19
     * This method is called before a test is executed.
20
     */
21
    protected function setUp()
22
    {
23
        $this->uri = new FilterableUri(
24
            '/domains/special',
25
            'http://example.org'
26
        );
27
    }
28
29
    /**
30
     * @covers VDB\Spider\Uri\FilterableUri::setFiltered
31
     * @covers VDB\Spider\Uri\FilterableUri::isFiltered
32
     * @covers VDB\Spider\Uri\FilterableUri::getFilterReason
33
     */
34
    public function testSetFiltered()
35
    {
36
        $this->uri->setFiltered(true, 'goodReason');
37
        $this->assertTrue($this->uri->isFiltered());
38
        $this->assertEquals('goodReason', $this->uri->getFilterReason());
39
    }
40
41
    /**
42
     * @covers VDB\Spider\Uri\FilterableUri::getIdentifier
43
     * @todo   Implement testGetIdentifier().
44
     */
45
    public function testGetIdentifier()
46
    {
47
        $this->assertEquals('http://example.org/domains/special', $this->uri->getIdentifier());
48
    }
49
}
50