ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
WorksheetRowTest.php
Go to the documentation of this file.
1 <?php
2 
4 {
5  public $mockWorksheet;
6  public $mockRow;
7 
8  public function setUp()
9  {
10  if (!defined('PHPEXCEL_ROOT')) {
11  define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
12  }
13  require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
14 
15  $this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
16  ->disableOriginalConstructor()
17  ->getMock();
18  $this->mockWorksheet->expects($this->any())
19  ->method('getHighestColumn')
20  ->will($this->returnValue('E'));
21  }
22 
23 
24  public function testInstantiateRowDefault()
25  {
26  $row = new PHPExcel_Worksheet_Row($this->mockWorksheet);
27  $this->assertInstanceOf('PHPExcel_Worksheet_Row', $row);
28  $rowIndex = $row->getRowIndex();
29  $this->assertEquals(1, $rowIndex);
30  }
31 
32  public function testInstantiateRowSpecified()
33  {
34  $row = new PHPExcel_Worksheet_Row($this->mockWorksheet, 5);
35  $this->assertInstanceOf('PHPExcel_Worksheet_Row', $row);
36  $rowIndex = $row->getRowIndex();
37  $this->assertEquals(5, $rowIndex);
38  }
39 
40  public function testGetCellIterator()
41  {
42  $row = new PHPExcel_Worksheet_Row($this->mockWorksheet);
43  $cellIterator = $row->getCellIterator();
44  $this->assertInstanceOf('PHPExcel_Worksheet_RowCellIterator', $cellIterator);
45  }
46 }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27