@@ -9,11 +9,23 @@ final class PHPJasperTest extends TestCase
9
9
* Class PHPJasperTest
10
10
*
11
11
* @author Rafael Queiroz <[email protected] >
12
+ * @author Daniel Rodrigues Lima ( geekcom ) <[email protected] >
12
13
* @package PHPJasper
13
14
*/
14
15
{
15
- private $ input = '../examples/hello_world.jrxml ' ;
16
- private $ output = '../examples ' ;
16
+ private $ PHPJasper ;
17
+ private $ input ;
18
+ private $ output ;
19
+
20
+ public function setUp ()
21
+ {
22
+ $ this ->PHPJasper = new PHPJasper ();
23
+ }
24
+
25
+ public function tearDown ()
26
+ {
27
+ unset($ this ->PHPJasper );
28
+ }
17
29
18
30
public function testConstructor ()
19
31
{
@@ -22,20 +34,18 @@ public function testConstructor()
22
34
23
35
public function testCompile ()
24
36
{
25
- $ jasper = new PHPJasper ();
26
- $ result = $ jasper ->compile ($ this ->input );
37
+ $ result = $ this ->PHPJasper ->compile ('{input_file} ' , '{output_file} ' );
27
38
28
39
$ this ->assertInstanceOf (PHPJasper::class, $ result );
29
- $ this ->assertEquals ('jasperstarter compile "../examples/hello_world.jrxml " ' , $ result ->output ());
40
+ $ this ->assertEquals ('jasperstarter compile "{input_file}" -o "{output_file} " ' , $ result ->output ());
30
41
}
31
42
32
43
public function testListParameters ()
33
44
{
34
- $ jasper = new PHPJasper ();
35
- $ result = $ jasper ->listParameters ($ this ->input );
45
+ $ result = $ this ->PHPJasper ->listParameters ('{input_fille} ' );
36
46
37
47
$ this ->assertInstanceOf (PHPJasper::class, $ result );
38
- $ this ->assertEquals ('jasperstarter list_parameters "../examples/hello_world.jrxml " ' , $ result ->output ());
48
+ $ this ->assertEquals ('jasperstarter list_parameters "{input_fille} " ' , $ result ->output ());
39
49
}
40
50
41
51
/*public function testCompileWithWrongInput()
0 commit comments