Completed
Branch master (51b807)
by Frank
04:17 queued 02:02
created

BaseCommandTestCase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 2
1
<?php
2
/**
3
 * T3Bot.
4
 *
5
 * @author Frank Nägler <[email protected]>
6
 *
7
 * @link http://www.t3bot.de
8
 * @link http://wiki.typo3.org/T3Bot
9
 */
10
namespace T3Bot\Tests\Unit;
11
12
use React\EventLoop\LoopInterface;
13
use Slack\Payload;
14
use Slack\RealTimeClient;
15
use T3Bot\Commands\AbstractCommand;
16
17
/**
18
 * Class BaseCommandTestCase.
19
 */
20
21
/** @noinspection LongInheritanceChainInspection */
22
class BaseCommandTestCase extends BaseTestCase
23
{
24
    /**
25
     * @var AbstractCommand|\PHPUnit_Framework_MockObject_MockObject
26
     */
27
    protected $command;
28
29
    /**
30
     * @param string $commandClass
31
     * @param array $payloadData
32
     */
33
    protected function initCommandWithPayload(string $commandClass, array $payloadData)
34
    {
35
        $loop = $this->getMock(LoopInterface::class);
36
        /** @var Payload $payload */
37
        $payload = new Payload($payloadData);
38
        /** @var RealTimeClient $client */
39
        $client = $this->getMock(RealTimeClient::class, [], [$loop]);
40
        $this->command = new $commandClass($payload, $client);
41
    }
42
}
43