@@ -30,11 +30,6 @@ public function setUp()
3030 $ this ->instance = new PHPJasper ();
3131 }
3232
33- public function tearDown ()
34- {
35- unset($ this ->instance );
36- }
37-
3833 /** @test */
3934 public function constructor ()
4035 {
@@ -44,22 +39,19 @@ public function constructor()
4439 /** @test */
4540 public function compile ()
4641 {
47- $ result = $ this ->instance ->compile ('examples/hello_world.jrxml ' , '{output_file} ' );
48-
49- $ expected = '.*jasperstarter compile ".*hello_world.jrxml" -o "{output_file}" ' ;
42+ $ result = $ this ->instance ->compile ('examples/hello_world.jrxml ' );
5043
51- $ this ->expectOutputRegex ('/ ' . $ expected . ' / ' , $ result ->output ());
44+ $ this ->expectOutputRegex ('/.*jasperstarter compile ".*hello_world.jrxml" / ' , $ result ->printOutput ());
5245 }
5346
54-
5547 /** @test */
5648 public function process ()
5749 {
5850 $ result = $ this ->instance ->process ('examples/hello_world.jrxml ' , '{output_file} ' );
5951
6052 $ expected = '.*jasperstarter process ".*hello_world.jrxml" -o "{output_file}" ' ;
6153
62- $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ result ->output ());
54+ $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ result ->printOutput ());
6355 }
6456
6557 /** @test */
@@ -85,15 +77,15 @@ public function processWithOptions()
8577 $ expected = '.*jasperstarter --locale en_US process ".*hello_world.jrxml" -o "{output_file}" ' ;
8678 $ expected .= '-f pdf -P param_1="value_1" param_2="value_2" -t driver -u user -p 12345678 -n db -r foo ' ;
8779
88- $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ result ->output ());
80+ $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ result ->printOutput ());
8981 }
9082
9183 /** @test */
9284 public function listParameters ()
9385 {
9486 $ result = $ this ->instance ->listParameters ('examples/hello_world.jrxml ' );
9587
96- $ this ->expectOutputRegex ('/.*jasperstarter list_parameters ".*hello_world.jrxml"/ ' , $ result ->output ());
88+ $ this ->expectOutputRegex ('/.*jasperstarter list_parameters ".*hello_world.jrxml"/ ' , $ result ->printOutput ());
9789 }
9890
9991 /** @test */
@@ -104,14 +96,6 @@ public function compileWithWrongInput()
10496 $ this ->instance ->compile ('' );
10597 }
10698
107- /** @test */
108- public function compileHelloWorld ()
109- {
110- $ result = $ this ->instance ->compile ('examples/hello_world.jrxml ' );
111-
112- $ this ->expectOutputRegex ('/.*jasperstarter compile ".*hello_world.jrxml"/ ' , $ result ->output ());
113- }
114-
11599 /** @test */
116100 public function outputWithUserOnExecute ()
117101 {
@@ -121,7 +105,7 @@ public function outputWithUserOnExecute()
121105
122106 $ expected = 'su -u 1000 -c "./jasperstarter compile "/var/www/app/tests/test.jrxml" -o "/var/www/app/tests/test"" ' ;
123107
124- $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ this ->instance ->output ());
108+ $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ this ->instance ->printOutput ());
125109 }
126110
127111 /** @test */
@@ -204,4 +188,12 @@ public function processWithWrongFormat()
204188 ]
205189 );
206190 }
191+
192+ /** @test */
193+ public function output ()
194+ {
195+ $ result = $ this ->instance ->listParameters ('examples/hello_world.jrxml ' );
196+
197+ $ this ->expectOutputRegex ('/.*jasperstarter list_parameters ".*hello_world.jrxml ' . '/ ' , $ result ->output () . "\n" );
198+ }
207199}
0 commit comments