These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace Redaxscript\Tests\Console\Command; |
||
3 | |||
4 | use org\bovigo\vfs\vfsStream as Stream; |
||
5 | use Redaxscript\Console\Command; |
||
6 | use Redaxscript\Tests\TestCaseAbstract; |
||
7 | |||
8 | /** |
||
9 | * RestoreTest |
||
10 | * |
||
11 | * @since 3.0.0 |
||
12 | * |
||
13 | * @package Redaxscript |
||
14 | * @category Tests |
||
15 | * @author Henry Ruhs |
||
16 | * |
||
17 | * @covers Redaxscript\Console\Command\CommandAbstract |
||
18 | * @covers Redaxscript\Console\Command\Restore |
||
19 | * |
||
20 | * @requires OS Linux |
||
21 | */ |
||
22 | |||
23 | class RestoreTest extends TestCaseAbstract |
||
24 | { |
||
25 | /** |
||
26 | * setUp |
||
27 | * |
||
28 | * @since 3.0.0 |
||
29 | */ |
||
30 | |||
31 | public function setUp() : void |
||
32 | { |
||
33 | parent::setUp(); |
||
34 | Stream::setup('root', 0777, $this->getJSON('tests' . DIRECTORY_SEPARATOR . 'unit-provider' . DIRECTORY_SEPARATOR . 'Console' . DIRECTORY_SEPARATOR . 'ConsoleTest_setUp.json')); |
||
0 ignored issues
–
show
|
|||
35 | } |
||
36 | |||
37 | /** |
||
38 | * tearDown |
||
39 | * |
||
40 | * @since 3.0.0 |
||
41 | */ |
||
42 | |||
43 | public function tearDown() : void |
||
44 | { |
||
45 | $this->dropDatabase(); |
||
46 | $this->_request->setServer('argv', null); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * testNoArgument |
||
51 | * |
||
52 | * @since 3.0.0 |
||
53 | */ |
||
54 | |||
55 | public function testNoArgument() : void |
||
56 | { |
||
57 | /* setup */ |
||
58 | |||
59 | $restoreCommand = new Command\Restore($this->_registry, $this->_request, $this->_language, $this->_config); |
||
60 | |||
61 | /* expect and actual */ |
||
62 | |||
63 | $expect = $restoreCommand->getHelp(); |
||
64 | $actual = $restoreCommand->run('cli'); |
||
65 | |||
66 | /* compare */ |
||
67 | |||
68 | $this->assertEquals($expect, $actual); |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * testDatabase |
||
73 | * |
||
74 | * @since 3.0.0 |
||
75 | */ |
||
76 | |||
77 | public function testDatabase() : void |
||
78 | { |
||
79 | /* setup */ |
||
80 | |||
81 | $this->_request->setServer('argv', |
||
82 | [ |
||
83 | 'console.php', |
||
84 | 'restore', |
||
85 | 'database', |
||
86 | '--directory', |
||
87 | Stream::url('root' . DIRECTORY_SEPARATOR . 'build'), |
||
88 | '--file', |
||
89 | 'test.sql' |
||
90 | ]); |
||
91 | $restoreCommand = new Command\Restore($this->_registry, $this->_request, $this->_language, $this->_config); |
||
92 | |||
93 | /* expect and actual */ |
||
94 | |||
95 | if ($this->_config->get('dbType') === 'sqlite') |
||
96 | { |
||
97 | $this->markTestSkipped(); |
||
98 | } |
||
99 | $expect = $restoreCommand->success(); |
||
100 | $actual = $restoreCommand->run('cli'); |
||
101 | |||
102 | /* compare */ |
||
103 | |||
104 | $this->assertEquals($expect, $actual); |
||
105 | } |
||
106 | |||
107 | /** |
||
108 | * testDatabaseInvalid |
||
109 | * |
||
110 | * @since 3.0.0 |
||
111 | */ |
||
112 | |||
113 | public function testDatabaseInvalid() : void |
||
114 | { |
||
115 | /* setup */ |
||
116 | |||
117 | $this->_request->setServer('argv', |
||
118 | [ |
||
119 | 'console.php', |
||
120 | 'restore', |
||
121 | 'database', |
||
122 | '--no-interaction' |
||
123 | ]); |
||
124 | $restoreCommand = new Command\Restore($this->_registry, $this->_request, $this->_language, $this->_config); |
||
125 | |||
126 | /* expect and actual */ |
||
127 | |||
128 | $expect = $restoreCommand->error(); |
||
129 | $actual = $restoreCommand->run('cli'); |
||
130 | |||
131 | /* compare */ |
||
132 | |||
133 | $this->assertEquals($expect, $actual); |
||
134 | } |
||
135 | } |
||
136 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.