1 | <?php |
||
12 | class ActionTest extends \PHPUnit_Framework_TestCase |
||
13 | { |
||
14 | /** |
||
15 | * Tests Action::getType |
||
16 | */ |
||
17 | public function testGetType() |
||
18 | { |
||
19 | $action = new Action('php', '\\Foo\\Bar'); |
||
20 | |||
21 | $this->assertEquals('php', $action->getType()); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * Tests Action::getAction |
||
26 | */ |
||
27 | public function testGetAction() |
||
28 | { |
||
29 | $action = new Action('php', '\\Foo\\Bar'); |
||
30 | $this->assertEquals('\\Foo\\Bar', $action->getAction()); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Tests Action::getOption |
||
35 | */ |
||
36 | public function testGetOptions() |
||
37 | { |
||
38 | $action = new Action('php', '\\Foo\\Bar'); |
||
39 | $this->assertEquals([], $action->getOptions()); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * Tests Action::__construct |
||
44 | */ |
||
45 | public function testEmptyOptions() |
||
46 | { |
||
47 | $action = new Action('php', '\\Foo\\Bar'); |
||
48 | $config = $action->getJsonData(); |
||
49 | |||
50 | $this->assertEquals(0, count($config['options'])); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Tests Action::__construct |
||
55 | * |
||
56 | * @expectedException \Exception |
||
57 | */ |
||
58 | public function testInvalidType() |
||
59 | { |
||
60 | $action = new Action('crap', 'with cinnamon and sugar'); |
||
61 | } |
||
62 | } |
||
63 |