1: <?php
2:
3: namespace Chromabits\Nucleus\Testing\Traits;
4:
5: use Mockery;
6: use Mockery\Matcher\Type;
7: use Mockery\MockInterface;
8:
9: /**
10: * Trait MockingTrait.
11: *
12: * @author Eduardo Trujillo <ed@chromabits.com>
13: * @package Chromabits\Nucleus\Testing\Traits
14: */
15: trait MockingTrait
16: {
17: /**
18: * Shortcut for Mockery.
19: *
20: * @param string $type
21: *
22: * @return MockInterface
23: */
24: public function mock($type)
25: {
26: return Mockery::mock($type);
27: }
28:
29: /**
30: * Shortcut for Mockery's Type Matcher.
31: *
32: * @param string $type
33: *
34: * @return Type
35: */
36: public function matchType($type)
37: {
38: return Mockery::type($type);
39: }
40: }