update 1.0.8.0

Commits for version update
This commit is contained in:
Manish Verma
2016-10-17 12:02:27 +05:30
parent dec927987b
commit 76e85db070
9674 changed files with 495757 additions and 58922 deletions

View File

@@ -0,0 +1,55 @@
<?php
class DataSeriesValuesTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetDataType()
{
$dataTypeValues = array(
'Number',
'String'
);
$testInstance = new PHPExcel_Chart_DataSeriesValues;
foreach($dataTypeValues as $dataTypeValue) {
$result = $testInstance->setDataType($dataTypeValue);
$this->assertTrue($result instanceof PHPExcel_Chart_DataSeriesValues);
}
}
public function testSetInvalidDataTypeThrowsException()
{
$testInstance = new PHPExcel_Chart_DataSeriesValues;
try {
$result = $testInstance->setDataType('BOOLEAN');
} catch (Exception $e) {
$this->assertEquals($e->getMessage(), 'Invalid datatype for chart data series values');
return;
}
$this->fail('An expected exception has not been raised.');
}
public function testGetDataType()
{
$dataTypeValue = 'String';
$testInstance = new PHPExcel_Chart_DataSeriesValues;
$setValue = $testInstance->setDataType($dataTypeValue);
$result = $testInstance->getDataType();
$this->assertEquals($dataTypeValue,$result);
}
}

View File

@@ -0,0 +1,37 @@
<?php
class LayoutTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetLayoutTarget()
{
$LayoutTargetValue = 'String';
$testInstance = new PHPExcel_Chart_Layout;
$result = $testInstance->setLayoutTarget($LayoutTargetValue);
$this->assertTrue($result instanceof PHPExcel_Chart_Layout);
}
public function testGetLayoutTarget()
{
$LayoutTargetValue = 'String';
$testInstance = new PHPExcel_Chart_Layout;
$setValue = $testInstance->setLayoutTarget($LayoutTargetValue);
$result = $testInstance->getLayoutTarget();
$this->assertEquals($LayoutTargetValue,$result);
}
}

View File

@@ -0,0 +1,134 @@
<?php
class LegendTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetPosition()
{
$positionValues = array(
PHPExcel_Chart_Legend::POSITION_RIGHT,
PHPExcel_Chart_Legend::POSITION_LEFT,
PHPExcel_Chart_Legend::POSITION_TOP,
PHPExcel_Chart_Legend::POSITION_BOTTOM,
PHPExcel_Chart_Legend::POSITION_TOPRIGHT,
);
$testInstance = new PHPExcel_Chart_Legend;
foreach($positionValues as $positionValue) {
$result = $testInstance->setPosition($positionValue);
$this->assertTrue($result);
}
}
public function testSetInvalidPositionReturnsFalse()
{
$testInstance = new PHPExcel_Chart_Legend;
$result = $testInstance->setPosition('BottomLeft');
$this->assertFalse($result);
// Ensure that value is unchanged
$result = $testInstance->getPosition();
$this->assertEquals(PHPExcel_Chart_Legend::POSITION_RIGHT,$result);
}
public function testGetPosition()
{
$PositionValue = PHPExcel_Chart_Legend::POSITION_BOTTOM;
$testInstance = new PHPExcel_Chart_Legend;
$setValue = $testInstance->setPosition($PositionValue);
$result = $testInstance->getPosition();
$this->assertEquals($PositionValue,$result);
}
public function testSetPositionXL()
{
$positionValues = array(
PHPExcel_Chart_Legend::xlLegendPositionBottom,
PHPExcel_Chart_Legend::xlLegendPositionCorner,
PHPExcel_Chart_Legend::xlLegendPositionCustom,
PHPExcel_Chart_Legend::xlLegendPositionLeft,
PHPExcel_Chart_Legend::xlLegendPositionRight,
PHPExcel_Chart_Legend::xlLegendPositionTop,
);
$testInstance = new PHPExcel_Chart_Legend;
foreach($positionValues as $positionValue) {
$result = $testInstance->setPositionXL($positionValue);
$this->assertTrue($result);
}
}
public function testSetInvalidXLPositionReturnsFalse()
{
$testInstance = new PHPExcel_Chart_Legend;
$result = $testInstance->setPositionXL(999);
$this->assertFalse($result);
// Ensure that value is unchanged
$result = $testInstance->getPositionXL();
$this->assertEquals(PHPExcel_Chart_Legend::xlLegendPositionRight,$result);
}
public function testGetPositionXL()
{
$PositionValue = PHPExcel_Chart_Legend::xlLegendPositionCorner;
$testInstance = new PHPExcel_Chart_Legend;
$setValue = $testInstance->setPositionXL($PositionValue);
$result = $testInstance->getPositionXL();
$this->assertEquals($PositionValue,$result);
}
public function testSetOverlay()
{
$overlayValues = array(
TRUE,
FALSE,
);
$testInstance = new PHPExcel_Chart_Legend;
foreach($overlayValues as $overlayValue) {
$result = $testInstance->setOverlay($overlayValue);
$this->assertTrue($result);
}
}
public function testSetInvalidOverlayReturnsFalse()
{
$testInstance = new PHPExcel_Chart_Legend;
$result = $testInstance->setOverlay('INVALID');
$this->assertFalse($result);
$result = $testInstance->getOverlay();
$this->assertFalse($result);
}
public function testGetOverlay()
{
$OverlayValue = TRUE;
$testInstance = new PHPExcel_Chart_Legend;
$setValue = $testInstance->setOverlay($OverlayValue);
$result = $testInstance->getOverlay();
$this->assertEquals($OverlayValue,$result);
}
}