File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55namespace VasekPurchart \Phing \SymfonyCommand ;
66
7+ use PHPUnit \Framework \Assert ;
78use Project ;
89use VasekPurchart \Phing \PhingTester \PhingTester ;
910
@@ -89,13 +90,17 @@ public function testCallCommandAndOverrideDefaults(): void
8990
9091 public function testMissingApp (): void
9192 {
92- $ tester = new PhingTester (__DIR__ . '/symfony-command-task-integration-test.xml ' );
93+ $ buildFilePath = __DIR__ . '/symfony-command-task-integration-test.xml ' ;
94+ $ tester = new PhingTester ($ buildFilePath );
9395 $ target = __FUNCTION__ ;
9496
95- $ this ->expectException (\BuildException::class);
96- $ this ->expectExceptionMessageMatches ('~app.+required~ ' );
97-
98- $ tester ->executeTarget ($ target );
97+ try {
98+ $ tester ->executeTarget ($ target );
99+ Assert::fail ('Exception expected ' );
100+ } catch (\BuildException $ e ) {
101+ Assert::assertStringStartsWith ($ buildFilePath , $ e ->getLocation ()->toString ());
102+ Assert::assertRegExp ('~app.+required~ ' , $ e ->getMessage ());
103+ }
99104 }
100105
101106}
You can’t perform that action at this time.
0 commit comments