Completed
Push — master ( c5de01...c9c19d )
by
unknown
07:34 queued 05:10
created

RequestSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace spec\Coduo\TuTu\Config\Element;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
8
class RequestSpec extends ObjectBehavior
9
{
10
    function let()
11
    {
12
        $this->beConstructedWith('/foo');
13
    }
14
15
    function it_throw_exception_when_created_with_not_string_route()
16
    {
17
        $this->shouldThrow(new \InvalidArgumentException('Path must be a valid string.'))->during('__construct', [new \DateTime()]);
18
    }
19
20
    function it_throw_exception_when_created_with_empty_route()
21
    {
22
        $this->shouldThrow(new \InvalidArgumentException('Path can\'t be empty.'))->during('__construct', ['']);
23
    }
24
25
    function it_always_uppercase_allowed_methods()
26
    {
27
        $this->setAllowedMethods(['post', 'GeT']);
28
        $this->getAllowedMethods()->shouldReturn(['POST', 'GET']);
29
    }
30
31
    function it_always_return_path_with_slash_at_the_beginning()
32
    {
33
        $this->beConstructedWith('foo');
34
        $this->getPath()->shouldReturn('/foo');
35
    }
36
37
    function it_always_return_path_with_single_slash_at_the_beginning()
38
    {
39
        $this->beConstructedWith('//foo');
40
        $this->getPath()->shouldReturn('/foo');
41
    }
42
}
43