Updates to 3rd party libraries

Add Dockerfile and specific docker-php.ini
This commit is contained in:
2018-08-28 21:27:13 -04:00
parent 9edd6c1c35
commit d52454d1bb
511 changed files with 45960 additions and 2739 deletions

View File

@ -0,0 +1,62 @@
<?php
namespace PhpOffice\PhpSpreadsheetTests\Chart;
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
use PhpOffice\PhpSpreadsheet\Exception;
use PHPUnit\Framework\TestCase;
class DataSeriesValuesTest extends TestCase
{
public function testSetDataType()
{
$dataTypeValues = [
'Number',
'String',
];
$testInstance = new DataSeriesValues();
foreach ($dataTypeValues as $dataTypeValue) {
$result = $testInstance->setDataType($dataTypeValue);
self::assertInstanceOf(DataSeriesValues::class, $result);
}
}
public function testSetInvalidDataTypeThrowsException()
{
$testInstance = new DataSeriesValues();
try {
$testInstance->setDataType('BOOLEAN');
} catch (Exception $e) {
self::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 DataSeriesValues();
$testInstance->setDataType($dataTypeValue);
$result = $testInstance->getDataType();
self::assertEquals($dataTypeValue, $result);
}
public function testGetLineWidth()
{
$testInstance = new DataSeriesValues();
self::assertEquals(12700, $testInstance->getLineWidth(), 'should have default');
$testInstance->setLineWidth(40000);
self::assertEquals(40000, $testInstance->getLineWidth());
$testInstance->setLineWidth(1);
self::assertEquals(12700, $testInstance->getLineWidth(), 'should enforce minimum width');
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace PhpOffice\PhpSpreadsheetTests\Chart;
use PhpOffice\PhpSpreadsheet\Chart\Layout;
use PHPUnit\Framework\TestCase;
class LayoutTest extends TestCase
{
public function testSetLayoutTarget()
{
$LayoutTargetValue = 'String';
$testInstance = new Layout();
$result = $testInstance->setLayoutTarget($LayoutTargetValue);
self::assertInstanceOf(Layout::class, $result);
}
public function testGetLayoutTarget()
{
$LayoutTargetValue = 'String';
$testInstance = new Layout();
$testInstance->setLayoutTarget($LayoutTargetValue);
$result = $testInstance->getLayoutTarget();
self::assertEquals($LayoutTargetValue, $result);
}
}

View File

@ -0,0 +1,127 @@
<?php
namespace PhpOffice\PhpSpreadsheetTests\Chart;
use PhpOffice\PhpSpreadsheet\Chart\Legend;
use PHPUnit\Framework\TestCase;
class LegendTest extends TestCase
{
public function testSetPosition()
{
$positionValues = [
Legend::POSITION_RIGHT,
Legend::POSITION_LEFT,
Legend::POSITION_TOP,
Legend::POSITION_BOTTOM,
Legend::POSITION_TOPRIGHT,
];
$testInstance = new Legend();
foreach ($positionValues as $positionValue) {
$result = $testInstance->setPosition($positionValue);
self::assertTrue($result);
}
}
public function testSetInvalidPositionReturnsFalse()
{
$testInstance = new Legend();
$result = $testInstance->setPosition('BottomLeft');
self::assertFalse($result);
// Ensure that value is unchanged
$result = $testInstance->getPosition();
self::assertEquals(Legend::POSITION_RIGHT, $result);
}
public function testGetPosition()
{
$PositionValue = Legend::POSITION_BOTTOM;
$testInstance = new Legend();
$testInstance->setPosition($PositionValue);
$result = $testInstance->getPosition();
self::assertEquals($PositionValue, $result);
}
public function testSetPositionXL()
{
$positionValues = [
Legend::XL_LEGEND_POSITION_BOTTOM,
Legend::XL_LEGEND_POSITION_CORNER,
Legend::XL_LEGEND_POSITION_CUSTOM,
Legend::XL_LEGEND_POSITION_LEFT,
Legend::XL_LEGEND_POSITION_RIGHT,
Legend::XL_LEGEND_POSITION_TOP,
];
$testInstance = new Legend();
foreach ($positionValues as $positionValue) {
$result = $testInstance->setPositionXL($positionValue);
self::assertTrue($result);
}
}
public function testSetInvalidXLPositionReturnsFalse()
{
$testInstance = new Legend();
$result = $testInstance->setPositionXL(999);
self::assertFalse($result);
// Ensure that value is unchanged
$result = $testInstance->getPositionXL();
self::assertEquals(Legend::XL_LEGEND_POSITION_RIGHT, $result);
}
public function testGetPositionXL()
{
$PositionValue = Legend::XL_LEGEND_POSITION_CORNER;
$testInstance = new Legend();
$testInstance->setPositionXL($PositionValue);
$result = $testInstance->getPositionXL();
self::assertEquals($PositionValue, $result);
}
public function testSetOverlay()
{
$overlayValues = [
true,
false,
];
$testInstance = new Legend();
foreach ($overlayValues as $overlayValue) {
$result = $testInstance->setOverlay($overlayValue);
self::assertTrue($result);
}
}
public function testSetInvalidOverlayReturnsFalse()
{
$testInstance = new Legend();
$result = $testInstance->setOverlay('INVALID');
self::assertFalse($result);
$result = $testInstance->getOverlay();
self::assertFalse($result);
}
public function testGetOverlay()
{
$OverlayValue = true;
$testInstance = new Legend();
$testInstance->setOverlay($OverlayValue);
$result = $testInstance->getOverlay();
self::assertEquals($OverlayValue, $result);
}
}