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

FilterableUriTest::testGetIdentifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
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
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