Completed
Push — master ( 22d3fd...d7530b )
by Risan Bagja
02:43
created

PageParserTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A page_parser_can_retrieve_page_content() 0 6 1
A page_parser_can_instantiate_crawler() 0 6 1
1
<?php
2
3
use Ktp\Parsers\PageParser;
4
use Symfony\Component\DomCrawler\Crawler;
5
6
class PageParserTest extends PHPUnit_Framework_TestCase {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
    /** @test */
8
    function page_parser_can_retrieve_page_content()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
9
    {
10
        $pageParser = $this->getMockForAbstractClass(PageParser::class, ['foo']);
11
12
        $this->assertEquals('foo', $pageParser->page());
13
    }
14
15
    /** @test */
16
    function page_parser_can_instantiate_crawler()
17
    {
18
        $pageParser = $this->getMockForAbstractClass(PageParser::class, ['foo']);
19
20
        $this->assertInstanceOf(Crawler::class, $pageParser->crawler());
21
    }
22
}
23