Skip to content

Commit d951d44

Browse files
authored
Merge pull request #70 from dbould/increase-test-coverage
Increase test coverage
2 parents 3a02a59 + 4ef11fa commit d951d44

File tree

3 files changed

+437
-4
lines changed

3 files changed

+437
-4
lines changed

phpunit.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
<filter>
1414
<whitelist>
15-
<directory>src/PHPJasper</directory>
16-
<directory>src/JasperStarter</directory>
15+
<directory suffix=".php">./src</directory>
1716
</whitelist>
1817
</filter>
1918

tests/PHPJasper/PHPJasperTest.php

+22-2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,27 @@ public function testExecuteWithCompile()
103103
$jasper = new PHPJasper();
104104
$jasper->compile('hello_world.jrxml')->execute();
105105
}
106+
107+
public function testExecute()
108+
{
109+
$jasper = new PHPJasper();
110+
$actual = $jasper->compile(__DIR__ . '/test.jrxml')->execute();
111+
112+
$this->assertInternalType('array', $actual);
113+
}
114+
115+
public function testResourceDirectoryException()
116+
{
117+
$this->expectException(\PHPJasper\Exception\InvalidResourceDirectory::class);
118+
119+
$jasper = new PHPJasper();
120+
$jasperReflection = new \ReflectionClass(get_class($jasper));
121+
$property = $jasperReflection->getProperty('pathExecutable');
122+
$property->setAccessible(true);
123+
$property->setValue($jasper,'');
124+
125+
$jasper->compile(__DIR__ . '/test.jrxml')->execute();
126+
}
106127

107128
public function testListParametersWithWrongInput()
108129
{
@@ -129,11 +150,10 @@ public function testProcessWithWrongFormat()
129150
'format' => 'mp3'
130151
]);
131152
}
132-
153+
133154
public function testProcess()
134155
{
135156
$jasper = new PHPJasper();
136157
$this->assertInstanceOf(PHPJasper::class, $jasper->process('hello_world.jrxml', ""));
137158
}
138-
139159
}

0 commit comments

Comments
 (0)