1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of graze/dynamark3-client. |
5
|
|
|
* |
6
|
|
|
* Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
* |
11
|
|
|
* @license https://github.com/graze/dynamark3-client/blob/master/LICENSE.md |
12
|
|
|
* @link https://github.com/graze/dynamark3-client |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
namespace Graze\Dynamark3Client\Test\Functional; |
16
|
|
|
|
17
|
|
|
use \Graze\Dynamark3Client\CommandResolver; |
18
|
|
|
use \Graze\Dynamark3Client\Command\CommandGeneric; |
19
|
|
|
use \Graze\Dynamark3Client\Command\CommandGetxml; |
20
|
|
|
|
21
|
|
|
class Dynamark3ResolverTest extends \PHPUnit_Framework_TestCase |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @dataProvider dataProviderResolve |
25
|
|
|
* |
26
|
|
|
* @param string $expectedInstance |
27
|
|
|
* @param string $name |
28
|
|
|
* @param string $expectedCommandText |
29
|
|
|
* |
30
|
|
|
* @return void |
31
|
|
|
*/ |
32
|
|
|
public function testResolve($expectedInstance, $name, $expectedCommandText) |
33
|
|
|
{ |
34
|
|
|
$commandResolver = new CommandResolver(); |
35
|
|
|
$command = $commandResolver->resolve($name); |
36
|
|
|
|
37
|
|
|
$this->assertInstanceOf($expectedInstance, $command); |
38
|
|
|
$this->assertEquals($expectedCommandText, $command->getCommandText()); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @return array |
43
|
|
|
*/ |
44
|
|
|
public function dataProviderResolve() |
45
|
|
|
{ |
46
|
|
|
return [ |
47
|
|
|
[CommandGeneric::class, 'markStop', 'MARK STOP'], |
48
|
|
|
[CommandGetxml::class, 'getXml', 'GETXML'] |
49
|
|
|
]; |
50
|
|
|
} |
51
|
|
|
} |
52
|
|
|
|