Skip to content

Commit 29b5579

Browse files
committed
Added missing coverage for exception
1 parent 766151b commit 29b5579

File tree

2 files changed

+428
-2
lines changed

2 files changed

+428
-2
lines changed

tests/PHPJasper/PHPJasperTest.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,19 @@ public function testExecuteWithCompile()
103103
$jasper = new PHPJasper();
104104
$jasper->compile('hello_world.jrxml')->execute();
105105
}
106+
107+
public function testResourceDirectoryException()
108+
{
109+
$this->expectException(\PHPJasper\Exception\InvalidResourceDirectory::class);
110+
111+
$jasper = new PHPJasper();
112+
$jasperReflection = new \ReflectionClass(get_class($jasper));
113+
$property = $jasperReflection->getProperty('pathExecutable');
114+
$property->setAccessible(true);
115+
$property->setValue($jasper,'');
116+
117+
$jasper->compile(__DIR__ . '/test.jrxml')->execute();
118+
}
106119

107120
public function testListParametersWithWrongInput()
108121
{
@@ -129,11 +142,10 @@ public function testProcessWithWrongFormat()
129142
'format' => 'mp3'
130143
]);
131144
}
132-
145+
133146
public function testProcess()
134147
{
135148
$jasper = new PHPJasper();
136149
$this->assertInstanceOf(PHPJasper::class, $jasper->process('hello_world.jrxml', ""));
137150
}
138-
139151
}

0 commit comments

Comments
 (0)