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

FilterableUriTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
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