|
1 | 1 | <?php
|
2 | 2 | use mikehaertl\shellcommand\Command;
|
3 | 3 |
|
4 |
| -class CommandTest extends \PHPUnit_Framework_TestCase |
| 4 | +class CommandTest extends \PHPUnit\Framework\TestCase |
5 | 5 | {
|
6 | 6 | public function setUp()
|
7 | 7 | {
|
@@ -119,13 +119,13 @@ public function testCanRunCommandWithArguments()
|
119 | 119 | public function testCanRunValidCommand()
|
120 | 120 | {
|
121 | 121 | $dir = __DIR__;
|
122 |
| - $command = new Command("/bin/ls $dir"); |
| 122 | + $command = new Command("/bin/ls $dir/Command*"); |
123 | 123 |
|
124 | 124 | $this->assertFalse($command->getExecuted());
|
125 | 125 | $this->assertTrue($command->execute());
|
126 | 126 | $this->assertTrue($command->getExecuted());
|
127 |
| - $this->assertEquals("CommandTest.php", $command->getOutput()); |
128 |
| - $this->assertEquals("CommandTest.php\n", $command->getOutput(false)); |
| 127 | + $this->assertEquals("$dir/CommandTest.php", $command->getOutput()); |
| 128 | + $this->assertEquals("$dir/CommandTest.php\n", $command->getOutput(false)); |
129 | 129 | $this->assertEmpty($command->getError());
|
130 | 130 | $this->assertEmpty($command->getStdErr());
|
131 | 131 | $this->assertEquals(0, $command->getExitCode());
|
@@ -170,13 +170,13 @@ public function testCanCastToString()
|
170 | 170 | public function testCanRunValidCommandWithExec()
|
171 | 171 | {
|
172 | 172 | $dir = __DIR__;
|
173 |
| - $command = new Command("/bin/ls $dir"); |
| 173 | + $command = new Command("/bin/ls $dir/Command*"); |
174 | 174 | $command->useExec = true;
|
175 | 175 |
|
176 | 176 | $this->assertFalse($command->getExecuted());
|
177 | 177 | $this->assertTrue($command->execute());
|
178 | 178 | $this->assertTrue($command->getExecuted());
|
179 |
| - $this->assertEquals("CommandTest.php", $command->getOutput()); |
| 179 | + $this->assertEquals("$dir/CommandTest.php", $command->getOutput()); |
180 | 180 | $this->assertEmpty($command->getError());
|
181 | 181 | $this->assertEmpty($command->getStdErr());
|
182 | 182 | $this->assertEquals(0, $command->getExitCode());
|
|
0 commit comments