Completed
Push — master ( 1b8ca6...90d75c )
by Mahmoud
03:54
created

TestsMockHelperTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A mock() 0 7 1
1
<?php
2
3
namespace App\Ship\Features\Tests\PhpUnit;
4
5
use App;
6
use Mockery;
7
8
/**
9
 * Class TestsMockHelperTrait
10
 *
11
 * Tests helper for mocking objects and services.
12
 *
13
 * @author  Mahmoud Zalt  <[email protected]>
14
 */
15
trait TestsMockHelperTrait
16
{
17
18
    /**
19
     * Mocking helper
20
     *
21
     * @param $class
22
     *
23
     * @return  \Mockery\MockInterface
24
     */
25
    public function mock($class)
26
    {
27
        $mock = Mockery::mock($class);
28
        App::instance($class, $mock);
29
30
        return $mock;
31
    }
32
}
33