コード例 #1
0
 /**
  * options
  */
 public function testOptions()
 {
     $e2h = new \tomk79\excel2html\main(__DIR__ . '/sample/cell_styled.xlsx');
     $src = $e2h->get_html(array());
     $options = $e2h->get_options();
     // var_dump($src);
     $this->assertEquals('strict', $options['renderer']);
     $e2h = new \tomk79\excel2html\main(__DIR__ . '/sample/cell_styled.xlsx');
     $src = $e2h->get_html(array('renderer' => 'simplify'));
     $options = $e2h->get_options();
     // var_dump($src);
     $this->assertEquals('simplify', $options['renderer']);
     $e2h = new \tomk79\excel2html\main(__DIR__ . '/sample/utf-8.csv');
     $src = $e2h->get_html(array('renderer' => 'strict'));
     $options = $e2h->get_options();
     // var_dump($src);
     $this->assertEquals('simplify', $options['renderer']);
     $this->assertTrue($options['render_cell_width']);
     $this->assertFalse($options['render_cell_borders']);
     $e2h = new \tomk79\excel2html\main(__DIR__ . '/sample/default.xlsx');
     $src = $e2h->get_html(array('header_row' => 1, 'header_col' => 1, 'renderer' => 'simplify', 'cell_renderer' => 'html', 'render_cell_width' => true, 'strip_table_tag' => true));
     $options = $e2h->get_options();
     // var_dump($src);
     $this->assertEquals('simplify', $options['renderer']);
     $this->assertTrue($options['render_cell_width']);
     $this->assertFalse($options['render_cell_borders']);
 }