@@ -30,11 +30,6 @@ public function setUp()
30
30
$ this ->instance = new PHPJasper ();
31
31
}
32
32
33
- public function tearDown ()
34
- {
35
- unset($ this ->instance );
36
- }
37
-
38
33
/** @test */
39
34
public function constructor ()
40
35
{
@@ -44,22 +39,19 @@ public function constructor()
44
39
/** @test */
45
40
public function compile ()
46
41
{
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 ' );
50
43
51
- $ this ->expectOutputRegex ('/ ' . $ expected . ' / ' , $ result ->output ());
44
+ $ this ->expectOutputRegex ('/.*jasperstarter compile ".*hello_world.jrxml" / ' , $ result ->printOutput ());
52
45
}
53
46
54
-
55
47
/** @test */
56
48
public function process ()
57
49
{
58
50
$ result = $ this ->instance ->process ('examples/hello_world.jrxml ' , '{output_file} ' );
59
51
60
52
$ expected = '.*jasperstarter process ".*hello_world.jrxml" -o "{output_file}" ' ;
61
53
62
- $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ result ->output ());
54
+ $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ result ->printOutput ());
63
55
}
64
56
65
57
/** @test */
@@ -85,15 +77,15 @@ public function processWithOptions()
85
77
$ expected = '.*jasperstarter --locale en_US process ".*hello_world.jrxml" -o "{output_file}" ' ;
86
78
$ expected .= '-f pdf -P param_1="value_1" param_2="value_2" -t driver -u user -p 12345678 -n db -r foo ' ;
87
79
88
- $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ result ->output ());
80
+ $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ result ->printOutput ());
89
81
}
90
82
91
83
/** @test */
92
84
public function listParameters ()
93
85
{
94
86
$ result = $ this ->instance ->listParameters ('examples/hello_world.jrxml ' );
95
87
96
- $ this ->expectOutputRegex ('/.*jasperstarter list_parameters ".*hello_world.jrxml"/ ' , $ result ->output ());
88
+ $ this ->expectOutputRegex ('/.*jasperstarter list_parameters ".*hello_world.jrxml"/ ' , $ result ->printOutput ());
97
89
}
98
90
99
91
/** @test */
@@ -104,14 +96,6 @@ public function compileWithWrongInput()
104
96
$ this ->instance ->compile ('' );
105
97
}
106
98
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
-
115
99
/** @test */
116
100
public function outputWithUserOnExecute ()
117
101
{
@@ -121,7 +105,7 @@ public function outputWithUserOnExecute()
121
105
122
106
$ expected = 'su -u 1000 -c "./jasperstarter compile "/var/www/app/tests/test.jrxml" -o "/var/www/app/tests/test"" ' ;
123
107
124
- $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ this ->instance ->output ());
108
+ $ this ->expectOutputRegex ('/ ' . $ expected . '/ ' , $ this ->instance ->printOutput ());
125
109
}
126
110
127
111
/** @test */
@@ -204,4 +188,12 @@ public function processWithWrongFormat()
204
188
]
205
189
);
206
190
}
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
+ }
207
199
}
0 commit comments