public function testCellValue() { $this->assertEquals('PROFIL', $this->sheet->cell_value(0, 0)); $this->assertEquals(100, $this->sheet->cell_value(1, 1)); $this->assertEquals(113, $this->sheet->cell_value(2, 2)); $this->assertEquals("2014-12-01 00:00:00", $this->sheet->cell_value(17, 2)); $this->assertEquals('12:03:00', $this->sheet->cell_value(18, 2)); $this->assertEquals('2015-12-01 13:37:01', $this->sheet->cell_value(19, 2)); $this->assertEquals('1900-01-01 00:00:00', $this->sheet->cell_value(20, 2)); $sheet = $this->book->getSheetByName('PROFILELEVELS'); $this->assertEquals(0.025, $sheet->cell_value(1, 1), null, 0.001); $this->assertEquals(265.212, $sheet->cell_value(1, 2), null, 0.001); $this->assertEquals('PROFIL', $this->sheet[0][0]->value); $this->assertEquals(100, $this->sheet[1][1]->value); $this->assertEquals(113, $this->sheet[2][2]->value); $this->assertEquals("2014-12-01 00:00:00", $this->sheet[17][2]->value); $this->assertEquals('12:03:00', $this->sheet[18][2]->value); $this->assertEquals('2015-12-01 13:37:01', $this->sheet[19][2]->value); $this->assertEquals('1900-01-01 00:00:00', $this->sheet[20][2]->value); $sheet = $this->book->getSheetByName('PROFILELEVELS'); $this->assertEquals(0.025, $sheet[1][1]->value, null, 0.001); $this->assertEquals(265.212, $sheet[1][2]->value, null, 0.001); }
public function testMergedCells() { $book = new Book(file_get_contents(__DIR__ . '/xls/merged.xls')); $sheet = $book->getSheetByName('Sheet1'); $this->assertEquals([[0, 1, 1, 4], [1, 2, 0, 2], [0, 2, 4, 5]], $sheet->merged_cells); $this->assertEquals(XL_CELL_BLANK, $sheet[0][0]->ctype); $this->assertEquals(XL_CELL_BLANK, $sheet[0][2]->ctype); $this->assertEquals(XL_CELL_BLANK, $sheet[1][2]->ctype); $this->assertEquals(XL_CELL_BLANK, $sheet[1][4]->ctype); $this->assertEquals(XL_CELL_TEXT, $sheet[0][1]->ctype); $this->assertEquals(XL_CELL_TEXT, $sheet[1][0]->ctype); $this->assertEquals(XL_CELL_TEXT, $sheet[1][3]->ctype); $this->assertEquals(XL_CELL_NUMBER, $sheet[0][4]->ctype); $this->assertEquals('MERGED A1:D1', $sheet[0][1]->value); $this->assertEquals('MERGED A2:B2', $sheet[1][0]->value); $this->assertEquals('D2', $sheet[1][3]->value); $this->assertEquals(1.0, $sheet[0][4]->value, '', 0.001); }
function testCommentsFormatting() { $sheet = $this->book->getSheetByName('Formate'); $note = $sheet->cell_note_map[1][0]; $this->assertEquals([[0, 11], [11, 31], [12, 32], [13, 10]], $note->rich_text_runlist); }
public function setUp() { $this->book = new Book(file_get_contents(__DIR__ . '/xls/Formate.xls')); $this->sheet = $this->book->getSheetByName('Blätt1'); }