@@ -12,7 +12,7 @@ function testTextPrinting():void
1212 $ app = new AnalyzeApplication ();
1313
1414 ob_start ();
15- $ app ->start (__DIR__ . '/fixtures/all-in.neon ' , ResultPrinter::FORMAT_TEXT );
15+ $ exitCode = $ app ->start (__DIR__ . '/fixtures/all-in.neon ' , ResultPrinter::FORMAT_TEXT );
1616 $ rendered = ob_get_clean ();
1717
1818 $ rendered = str_replace (__DIR__ , '' , $ rendered );
@@ -24,14 +24,15 @@ function testTextPrinting():void
2424PHP ;
2525
2626 $ this ->assertSame ($ expected , $ rendered );
27+ $ this ->assertSame (0 , $ exitCode );
2728 }
2829
2930 function testJsonPrinting ():void
3031 {
3132 $ app = new AnalyzeApplication ();
3233
3334 ob_start ();
34- $ app ->start (__DIR__ . '/fixtures/all-in.neon ' , ResultPrinter::FORMAT_JSON );
35+ $ exitCode = $ app ->start (__DIR__ . '/fixtures/all-in.neon ' , ResultPrinter::FORMAT_JSON );
3536 $ rendered = ob_get_clean ();
3637
3738 $ rendered = str_replace (trim (json_encode (__DIR__ ), '" ' ), '' , $ rendered );
@@ -41,5 +42,18 @@ function testJsonPrinting():void
4142PHP ;
4243
4344 $ this ->assertSame ($ expected , $ rendered );
45+ $ this ->assertSame (0 , $ exitCode );
46+ }
47+
48+ function testNoMatchingGlob ():void
49+ {
50+ $ app = new AnalyzeApplication ();
51+
52+ ob_start ();
53+ $ exitCode = $ app ->start ('this/file/does/not/exist*baseline.neon ' , ResultPrinter::FORMAT_TEXT );
54+ $ rendered = ob_get_clean ();
55+
56+ $ this ->assertSame ('' , $ rendered );
57+ $ this ->assertSame (1 , $ exitCode );
4458 }
4559}
0 commit comments