ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
DataSeriesValuesTest.php
Go to the documentation of this file.
1 <?php
2 
3 
5 {
6 
7  public function setUp()
8  {
9  if (!defined('PHPEXCEL_ROOT'))
10  {
11  define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
12  }
13  require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
14  }
15 
16  public function testSetDataType()
17  {
18  $dataTypeValues = array(
19  'Number',
20  'String'
21  );
22 
23  $testInstance = new PHPExcel_Chart_DataSeriesValues;
24 
25  foreach($dataTypeValues as $dataTypeValue) {
26  $result = $testInstance->setDataType($dataTypeValue);
27  $this->assertTrue($result instanceof PHPExcel_Chart_DataSeriesValues);
28  }
29  }
30 
32  {
33  $testInstance = new PHPExcel_Chart_DataSeriesValues;
34 
35  try {
36  $result = $testInstance->setDataType('BOOLEAN');
37  } catch (Exception $e) {
38  $this->assertEquals($e->getMessage(), 'Invalid datatype for chart data series values');
39  return;
40  }
41  $this->fail('An expected exception has not been raised.');
42  }
43 
44  public function testGetDataType()
45  {
46  $dataTypeValue = 'String';
47 
48  $testInstance = new PHPExcel_Chart_DataSeriesValues;
49  $setValue = $testInstance->setDataType($dataTypeValue);
50 
51  $result = $testInstance->getDataType();
52  $this->assertEquals($dataTypeValue,$result);
53  }
54 
55 }
$result
setDataType($dataType=self::DATASERIES_TYPE_NUMBER)
Set Series Data Type.
Create styles array
The data for the language used.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27