Skip to content

Commit

Permalink
Merge pull request #70 from dbould/increase-test-coverage
Browse files Browse the repository at this point in the history
Increase test coverage
  • Loading branch information
geekcom authored Oct 9, 2017
2 parents 3a02a59 + 4ef11fa commit d951d44
Show file tree
Hide file tree
Showing 3 changed files with 437 additions and 4 deletions.
3 changes: 1 addition & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

<filter>
<whitelist>
<directory>src/PHPJasper</directory>
<directory>src/JasperStarter</directory>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>

Expand Down
24 changes: 22 additions & 2 deletions tests/PHPJasper/PHPJasperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,27 @@ public function testExecuteWithCompile()
$jasper = new PHPJasper();
$jasper->compile('hello_world.jrxml')->execute();
}

public function testExecute()
{
$jasper = new PHPJasper();
$actual = $jasper->compile(__DIR__ . '/test.jrxml')->execute();

$this->assertInternalType('array', $actual);
}

public function testResourceDirectoryException()
{
$this->expectException(\PHPJasper\Exception\InvalidResourceDirectory::class);

$jasper = new PHPJasper();
$jasperReflection = new \ReflectionClass(get_class($jasper));
$property = $jasperReflection->getProperty('pathExecutable');
$property->setAccessible(true);
$property->setValue($jasper,'');

$jasper->compile(__DIR__ . '/test.jrxml')->execute();
}

public function testListParametersWithWrongInput()
{
Expand All @@ -129,11 +150,10 @@ public function testProcessWithWrongFormat()
'format' => 'mp3'
]);
}

public function testProcess()
{
$jasper = new PHPJasper();
$this->assertInstanceOf(PHPJasper::class, $jasper->process('hello_world.jrxml', ""));
}

}
Loading

0 comments on commit d951d44

Please sign in to comment.