InflectorSpec::let()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 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