|
12 | 12 | namespace Symfony\Component\Process\Tests; |
13 | 13 |
|
14 | 14 | use PHPUnit\Framework\TestCase; |
| 15 | +use Symfony\Component\Process\Exception\InvalidArgumentException; |
15 | 16 | use Symfony\Component\Process\Exception\LogicException; |
| 17 | +use Symfony\Component\Process\Exception\ProcessFailedException; |
| 18 | +use Symfony\Component\Process\Exception\ProcessSignaledException; |
16 | 19 | use Symfony\Component\Process\Exception\ProcessTimedOutException; |
17 | 20 | use Symfony\Component\Process\Exception\RuntimeException; |
18 | 21 | use Symfony\Component\Process\InputStream; |
@@ -78,13 +81,13 @@ public function testThatProcessDoesNotThrowWarningDuringRun() |
78 | 81 |
|
79 | 82 | public function testNegativeTimeoutFromConstructor() |
80 | 83 | { |
81 | | - $this->expectException(\Symfony\Component\Process\Exception\InvalidArgumentException::class); |
| 84 | + $this->expectException(InvalidArgumentException::class); |
82 | 85 | $this->getProcess('', null, null, null, -1); |
83 | 86 | } |
84 | 87 |
|
85 | 88 | public function testNegativeTimeoutFromSetter() |
86 | 89 | { |
87 | | - $this->expectException(\Symfony\Component\Process\Exception\InvalidArgumentException::class); |
| 90 | + $this->expectException(InvalidArgumentException::class); |
88 | 91 | $p = $this->getProcess(''); |
89 | 92 | $p->setTimeout(-1); |
90 | 93 | } |
@@ -292,7 +295,7 @@ public function testSetInputWhileRunningThrowsAnException() |
292 | 295 | */ |
293 | 296 | public function testInvalidInput($value) |
294 | 297 | { |
295 | | - $this->expectException(\Symfony\Component\Process\Exception\InvalidArgumentException::class); |
| 298 | + $this->expectException(InvalidArgumentException::class); |
296 | 299 | $this->expectExceptionMessage('"Symfony\Component\Process\Process::setInput" only accepts strings, Traversable objects or stream resources.'); |
297 | 300 | $process = $this->getProcess('foo'); |
298 | 301 | $process->setInput($value); |
@@ -555,7 +558,7 @@ public function testSuccessfulMustRunHasCorrectExitCode() |
555 | 558 |
|
556 | 559 | public function testMustRunThrowsException() |
557 | 560 | { |
558 | | - $this->expectException(\Symfony\Component\Process\Exception\ProcessFailedException::class); |
| 561 | + $this->expectException(ProcessFailedException::class); |
559 | 562 | $process = $this->getProcess('exit 1'); |
560 | 563 | $process->mustRun(); |
561 | 564 | } |
@@ -707,7 +710,7 @@ public function testProcessIsSignaledIfStopped() |
707 | 710 |
|
708 | 711 | public function testProcessThrowsExceptionWhenExternallySignaled() |
709 | 712 | { |
710 | | - $this->expectException(\Symfony\Component\Process\Exception\ProcessSignaledException::class); |
| 713 | + $this->expectException(ProcessSignaledException::class); |
711 | 714 | $this->expectExceptionMessage('The process has been signaled with signal "9".'); |
712 | 715 | if (!\function_exists('posix_kill')) { |
713 | 716 | $this->markTestSkipped('Function posix_kill is required.'); |
@@ -1485,15 +1488,15 @@ public function testPreparedCommandWithQuoteInIt() |
1485 | 1488 |
|
1486 | 1489 | public function testPreparedCommandWithMissingValue() |
1487 | 1490 | { |
1488 | | - $this->expectException(\Symfony\Component\Process\Exception\InvalidArgumentException::class); |
| 1491 | + $this->expectException(InvalidArgumentException::class); |
1489 | 1492 | $this->expectExceptionMessage('Command line is missing a value for parameter "abc": echo "${:abc}"'); |
1490 | 1493 | $p = Process::fromShellCommandline('echo "${:abc}"'); |
1491 | 1494 | $p->run(null, ['bcd' => 'BCD']); |
1492 | 1495 | } |
1493 | 1496 |
|
1494 | 1497 | public function testPreparedCommandWithNoValues() |
1495 | 1498 | { |
1496 | | - $this->expectException(\Symfony\Component\Process\Exception\InvalidArgumentException::class); |
| 1499 | + $this->expectException(InvalidArgumentException::class); |
1497 | 1500 | $this->expectExceptionMessage('Command line is missing a value for parameter "abc": echo "${:abc}"'); |
1498 | 1501 | $p = Process::fromShellCommandline('echo "${:abc}"'); |
1499 | 1502 | $p->run(null, []); |
|
0 commit comments