Completed
Push — master ( 64e8ff...9df0db )
by Derek
02:02
created

HttpReaderSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 42
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_initializable() 0 4 1
A it_retrieves_http_response_codes() 0 4 1
A it_provides_access_to_its_url() 0 4 1
1
<?php
2
namespace spec\Subreality\Dilmun\Anshar;
3
4
use Subreality\Dilmun\Anshar\HttpReader;
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
use Subreality\Dilmun\Nabu\Logger;
8
9
class HttpReaderSpec extends ObjectBehavior
10
{
11
    function let()
12
    {
13
        $this->beConstructedWith("https://www.google.com");
14
    }
15
16
    function it_is_initializable()
17
    {
18
        $this->shouldHaveType(HttpReader::class);
19
    }
20
21
    function it_retrieves_http_response_codes()
22
    {
23
        $this->getResponseCode()->shouldReturn("200");
24
    }
25
26
    function it_provides_access_to_its_url()
27
    {
28
        $this->getUrl()->shouldReturn("https://www.google.com");
29
    }
30
/*
0 ignored issues
show
Unused Code Comprehensibility introduced by
61% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
31
    function it_retrieves_the_url_contents()
32
    {
33
        $this->getContents()->shouldReturnAnInstanceOf('\DOMDocument');
34
    }
35
36
    function it_sets_a_logger(Logger $logger)
37
    {
38
        $this->setLogger($logger);
39
40
        $this->getLogger()->shouldReturn($logger);
41
    }
42
43
    function it_updates_a_log(Logger $logger)
44
    {
45
        $logger->info("Getting response code")->shouldBeCalled();
46
47
        $this->getResponseCode();
48
    }
49
*/
50
}
51