InflectorSpec   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A it_returns_itself_after_setting_the_word_to_inflect() 0 4 1
A let() 0 6 1
A it_is_initializable() 0 5 1
A it_inflects_the_request() 0 6 1
A it_inflects_the_job() 0 6 1
1
<?php
2
3
namespace spec\Cerbero\Workflow\Inflectors;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
use Cerbero\Workflow\Wrappers\NamespaceDetectorInterface;
8
9
class InflectorSpec extends ObjectBehavior
10
{
11
	function let(NamespaceDetectorInterface $detector)
12
	{
13
		$this->beConstructedWith($detector);
14
15
		$detector->detect()->willReturn('App');
16
	}
17
18
    function it_is_initializable()
19
    {
20
        $this->shouldHaveType('Cerbero\Workflow\Inflectors\Inflector');
21
        $this->shouldHaveType('Cerbero\Workflow\Inflectors\InflectorInterface');
22
    }
23
24
    /**
25
     * @testdox	It returns itself after setting the word to inflect.
26
     *
27
     * @author	Andrea Marco Sartori
28
     * @return	void
29
     */
30
    public function it_returns_itself_after_setting_the_word_to_inflect()
31
    {
32
    	$this->of('foo')->shouldReturn($this);
33
    }
34
35
    /**
36
     * @testdox	It inflects the request.
37
     *
38
     * @author	Andrea Marco Sartori
39
     * @return	void
40
     */
41
    public function it_inflects_the_request()
42
    {
43
    	$expected = 'App\Http\Requests\RegisterUserRequest';
44
45
    	$this->of('registerUser')->getRequest()->shouldReturn($expected);
46
    }
47
48
    /**
49
     * @testdox	It inflects the job.
50
     *
51
     * @author	Andrea Marco Sartori
52
     * @return	void
53
     */
54
    public function it_inflects_the_job()
55
    {
56
    	$expected = 'App\Jobs\RegisterUserJob';
57
58
    	$this->of('registerUser')->getJob()->shouldReturn($expected);
59
    }
60
}
61