Skip to content

update tests #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/geekcom/phpjasper/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/geekcom/phpjasper/?branch=master)
[![StyleCI](https://styleci.io/repos/46984485/shield?branch=master)](https://styleci.io/repos/46984485)
[![Latest Stable Version](https://poser.pugx.org/geekcom/phpjasper/v/stable)](https://packagist.org/packages/geekcom/phpjasper)
[![Total Downloads](https://poser.pugx.org/geekcom/phpjasper/downloads)](https://packagist.org/packages/geekcom/phpjasper)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-blue.svg?style=flat-square)](https://php.net/)
[![License](https://poser.pugx.org/geekcom/phpjasper/license)](https://packagist.org/packages/geekcom/phpjasper)
[![Bitcoin Donations](https://img.shields.io/badge/bitcoin-donation-orange.svg)](https://blockchain.info/address/1LqwqcMfNuNzq6S671z1HjM61MpBuFCGqg)

### Docs
[![Language-pt_BR](https://img.shields.io/badge/pt__BR-100%25-green.svg)](https://github.com/PHPJasper/phpjasper/blob/master/docs/pt_BR/LEIA-ME_pt_BR.md)
Expand Down
3 changes: 1 addition & 2 deletions docs/pt_BR/LEIA-ME_pt_BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/geekcom/phpjasper/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/geekcom/phpjasper/?branch=master)
[![StyleCI](https://styleci.io/repos/46984485/shield?branch=master)](https://styleci.io/repos/46984485)
[![Latest Stable Version](https://poser.pugx.org/geekcom/phpjasper/v/stable)](https://packagist.org/packages/geekcom/phpjasper)
[![Total Downloads](https://poser.pugx.org/geekcom/phpjasper/downloads)](https://packagist.org/packages/geekcom/phpjasper)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-blue.svg?style=flat-square)](https://php.net/)
[![License](https://poser.pugx.org/geekcom/phpjasper/license)](https://packagist.org/packages/geekcom/phpjasper)
[![Bitcoin Donations](https://img.shields.io/badge/bitcoin-donation-orange.svg)](https://blockchain.info/address/1LqwqcMfNuNzq6S671z1HjM61MpBuFCGqg)

### Documentação
[![Language-en_US](https://img.shields.io/badge/en__US-100%25-green.svg)](https://github.com/PHPJasper/phpjasper/blob/master/README.md)
Expand Down
26 changes: 18 additions & 8 deletions tests/PHPJasper/PHPJasperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@ final class PHPJasperTest extends TestCase
* Class PHPJasperTest
*
* @author Rafael Queiroz <[email protected]>
* @author Daniel Rodrigues Lima ( geekcom ) <[email protected]>
* @package PHPJasper
*/
{
private $input = '../examples/hello_world.jrxml';
private $output = '../examples';
private $PHPJasper;
private $input;
private $output;

public function setUp()
{
$this->PHPJasper = new PHPJasper();
}

public function tearDown()
{
unset($this->PHPJasper);
}

public function testConstructor()
{
Expand All @@ -22,20 +34,18 @@ public function testConstructor()

public function testCompile()
{
$jasper = new PHPJasper();
$result = $jasper->compile($this->input);
$result = $this->PHPJasper->compile('{input_file}', '{output_file}');

$this->assertInstanceOf(PHPJasper::class, $result);
$this->assertEquals('jasperstarter compile "../examples/hello_world.jrxml"', $result->output());
$this->assertEquals('jasperstarter compile "{input_file}" -o "{output_file}"', $result->output());
}

public function testListParameters()
{
$jasper = new PHPJasper();
$result = $jasper->listParameters($this->input);
$result = $this->PHPJasper->listParameters('{input_fille}');

$this->assertInstanceOf(PHPJasper::class, $result);
$this->assertEquals('jasperstarter list_parameters "../examples/hello_world.jrxml"', $result->output());
$this->assertEquals('jasperstarter list_parameters "{input_fille}"', $result->output());
}

/*public function testCompileWithWrongInput()
Expand Down