LoanSpec::it_can_exist()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 6
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace spec\Scriptotek\Alma\Users;
4
5
use PhpSpec\ObjectBehavior;
6
use Scriptotek\Alma\Bibs\Item;
7
use Scriptotek\Alma\Client as AlmaClient;
8
use Scriptotek\Alma\Users\Loan;
9
use Scriptotek\Alma\Users\User;
10
use spec\Scriptotek\Alma\SpecHelper;
11
12 View Code Duplication
class LoanSpec extends ObjectBehavior
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    public function let(AlmaClient $client, User $user, Item $item)
15
    {
16
        $loan_id = '123';
17
        $this->beConstructedWith($client, $user, $item, $loan_id);
18
    }
19
20
    public function it_is_initializable()
21
    {
22
        $this->shouldHaveType(Loan::class);
23
    }
24
25
    public function it_can_exist()
26
    {
27
        $this->init(SpecHelper::getDummyData('item_loan_response.json')->item_loan[0]);
28
29
        $this->exists()->shouldBe(true);
30
    }
31
}
32