init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
35
setup/test/JSON/JSONTest.php
Normal file
35
setup/test/JSON/JSONTest.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use SimpleExcel\SimpleExcel;
|
||||
|
||||
require_once('src/SimpleExcel/SimpleExcel.php');
|
||||
|
||||
class JSONTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testConstruct()
|
||||
{
|
||||
$excel = new SimpleExcel('JSON');
|
||||
return $excel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testConstruct
|
||||
*/
|
||||
public function testParser(SimpleExcel $excel)
|
||||
{
|
||||
$excel->parser->loadFile('test/JSON/test.json');
|
||||
$this->assertEquals(array('ID', 'Nama', 'Kode Wilayah'), $excel->parser->getRow(1));
|
||||
$this->assertEquals(array('1', 'Kab. Bogor', '1'), $excel->parser->getRow(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testConstruct
|
||||
*/
|
||||
public function testWriter(SimpleExcel $excel)
|
||||
{
|
||||
$excel->writer->addRow(array('ID', 'Nama', 'Kode Wilayah'));
|
||||
$this->assertEquals('[{"0":"ID","1":"Nama","2":"Kode Wilayah"}]', $excel->writer->saveString());
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue