]> git.mxchange.org Git - friendica.git/blob - tests/Util/HookMockTrait.php
Fix phpmailer (Case sensitive Check)
[friendica.git] / tests / Util / HookMockTrait.php
1 <?php
2
3 namespace Friendica\Test\Util;
4
5 use Friendica\Core\Hook;
6 use Mockery\MockInterface;
7
8 trait HookMockTrait
9 {
10
11         /**
12          * @var MockInterface The Interface for mocking a renderer
13          */
14         private $hookMock;
15
16         /**
17          * Mocking a method 'Hook::call()' call
18          *
19          */
20         public function mockHookCallAll(string $name, &$capture)
21         {
22                 if (!isset($this->hookMock)) {
23                         $this->hookMock = \Mockery::mock('alias:' . Hook::class);
24                 }
25
26                 $this->hookMock
27                         ->shouldReceive('callAll')
28                         ->withArgs([$name, \Mockery::capture($capture)]);
29         }
30 }