Completed
Push — master ( 174077...06b292 )
by Nicolai
08:59
created

WithMockery::partialMock()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
4
namespace SmartWeb\ModuleTesting\Util;
5
6
use Mockery;
7
use Mockery\MockInterface;
8
9
10
trait WithMockery
11
{
12
    
13
    /**
14
     * @param array $args
15
     *
16
     * @return MockInterface
17
     */
18
    protected function partialMock(...$args) : MockInterface
19
    {
20
        return $this->mock(...$args)
21
                    ->makePartial();
22
    }
23
    
24
    /**
25
     * @param array ...$args
26
     *
27
     * @return MockInterface
28
     */
29
    protected function mock(...$args) : MockInterface
30
    {
31
        return Mockery::mock(...$args)
32
                      ->shouldAllowMockingProtectedMethods();
33
    }
34
}