Updates to 3rd party libraries
Add Dockerfile and specific docker-php.ini
This commit is contained in:
54
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/CodePageTest.php
vendored
Normal file
54
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/CodePageTest.php
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Shared;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Exception;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\CodePage;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CodePageTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider providerCodePage
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testCodePageNumberToName($expectedResult, ...$args)
|
||||
{
|
||||
$result = CodePage::numberToName(...$args);
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerCodePage()
|
||||
{
|
||||
return require 'data/Shared/CodePage.php';
|
||||
}
|
||||
|
||||
public function testNumberToNameWithInvalidCodePage()
|
||||
{
|
||||
$invalidCodePage = 12345;
|
||||
|
||||
try {
|
||||
CodePage::numberToName($invalidCodePage);
|
||||
} catch (Exception $e) {
|
||||
self::assertEquals($e->getMessage(), 'Unknown codepage: 12345');
|
||||
|
||||
return;
|
||||
}
|
||||
$this->fail('An expected exception has not been raised.');
|
||||
}
|
||||
|
||||
public function testNumberToNameWithUnsupportedCodePage()
|
||||
{
|
||||
$unsupportedCodePage = 720;
|
||||
|
||||
try {
|
||||
CodePage::numberToName($unsupportedCodePage);
|
||||
} catch (Exception $e) {
|
||||
self::assertEquals($e->getMessage(), 'Code page 720 not supported.');
|
||||
|
||||
return;
|
||||
}
|
||||
$this->fail('An expected exception has not been raised.');
|
||||
}
|
||||
}
|
171
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/DateTest.php
vendored
Normal file
171
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/DateTest.php
vendored
Normal file
@ -0,0 +1,171 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Shared;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Date;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DateTest extends TestCase
|
||||
{
|
||||
public function testSetExcelCalendar()
|
||||
{
|
||||
$calendarValues = [
|
||||
Date::CALENDAR_MAC_1904,
|
||||
Date::CALENDAR_WINDOWS_1900,
|
||||
];
|
||||
|
||||
foreach ($calendarValues as $calendarValue) {
|
||||
$result = Date::setExcelCalendar($calendarValue);
|
||||
self::assertTrue($result);
|
||||
}
|
||||
}
|
||||
|
||||
public function testSetExcelCalendarWithInvalidValue()
|
||||
{
|
||||
$unsupportedCalendar = '2012';
|
||||
$result = Date::setExcelCalendar($unsupportedCalendar);
|
||||
self::assertFalse($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDateTimeExcelToTimestamp1900
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testDateTimeExcelToTimestamp1900($expectedResult, ...$args)
|
||||
{
|
||||
Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900);
|
||||
|
||||
$result = Date::excelToTimestamp(...$args);
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerDateTimeExcelToTimestamp1900()
|
||||
{
|
||||
return require 'data/Shared/Date/ExcelToTimestamp1900.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDateTimeTimestampToExcel1900
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testDateTimeTimestampToExcel1900($expectedResult, ...$args)
|
||||
{
|
||||
Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900);
|
||||
|
||||
$result = Date::timestampToExcel(...$args);
|
||||
self::assertEquals($expectedResult, $result, null, 1E-5);
|
||||
}
|
||||
|
||||
public function providerDateTimeTimestampToExcel1900()
|
||||
{
|
||||
return require 'data/Shared/Date/TimestampToExcel1900.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDateTimeDateTimeToExcel
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testDateTimeDateTimeToExcel($expectedResult, ...$args)
|
||||
{
|
||||
Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900);
|
||||
|
||||
$result = Date::dateTimeToExcel(...$args);
|
||||
self::assertEquals($expectedResult, $result, null, 1E-5);
|
||||
}
|
||||
|
||||
public function providerDateTimeDateTimeToExcel()
|
||||
{
|
||||
return require 'data/Shared/Date/DateTimeToExcel.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDateTimeFormattedPHPToExcel1900
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testDateTimeFormattedPHPToExcel1900($expectedResult, ...$args)
|
||||
{
|
||||
Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900);
|
||||
|
||||
$result = Date::formattedPHPToExcel(...$args);
|
||||
self::assertEquals($expectedResult, $result, null, 1E-5);
|
||||
}
|
||||
|
||||
public function providerDateTimeFormattedPHPToExcel1900()
|
||||
{
|
||||
return require 'data/Shared/Date/FormattedPHPToExcel1900.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDateTimeExcelToTimestamp1904
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testDateTimeExcelToTimestamp1904($expectedResult, ...$args)
|
||||
{
|
||||
Date::setExcelCalendar(Date::CALENDAR_MAC_1904);
|
||||
|
||||
$result = Date::excelToTimestamp(...$args);
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerDateTimeExcelToTimestamp1904()
|
||||
{
|
||||
return require 'data/Shared/Date/ExcelToTimestamp1904.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDateTimeTimestampToExcel1904
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testDateTimeTimestampToExcel1904($expectedResult, ...$args)
|
||||
{
|
||||
Date::setExcelCalendar(Date::CALENDAR_MAC_1904);
|
||||
|
||||
$result = Date::timestampToExcel(...$args);
|
||||
self::assertEquals($expectedResult, $result, null, 1E-5);
|
||||
}
|
||||
|
||||
public function providerDateTimeTimestampToExcel1904()
|
||||
{
|
||||
return require 'data/Shared/Date/TimestampToExcel1904.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIsDateTimeFormatCode
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testIsDateTimeFormatCode($expectedResult, ...$args)
|
||||
{
|
||||
$result = Date::isDateTimeFormatCode(...$args);
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerIsDateTimeFormatCode()
|
||||
{
|
||||
return require 'data/Shared/Date/FormatCodes.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDateTimeExcelToTimestamp1900Timezone
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testDateTimeExcelToTimestamp1900Timezone($expectedResult, ...$args)
|
||||
{
|
||||
Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900);
|
||||
|
||||
$result = Date::excelToTimestamp(...$args);
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerDateTimeExcelToTimestamp1900Timezone()
|
||||
{
|
||||
return require 'data/Shared/Date/ExcelToTimestamp1900Timezone.php';
|
||||
}
|
||||
}
|
32
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/FileTest.php
vendored
Normal file
32
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/FileTest.php
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Shared;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\File;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FileTest extends TestCase
|
||||
{
|
||||
public function testGetUseUploadTempDirectory()
|
||||
{
|
||||
$expectedResult = false;
|
||||
|
||||
$result = File::getUseUploadTempDirectory();
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testSetUseUploadTempDirectory()
|
||||
{
|
||||
$useUploadTempDirectoryValues = [
|
||||
true,
|
||||
false,
|
||||
];
|
||||
|
||||
foreach ($useUploadTempDirectoryValues as $useUploadTempDirectoryValue) {
|
||||
File::setUseUploadTempDirectory($useUploadTempDirectoryValue);
|
||||
|
||||
$result = File::getUseUploadTempDirectory();
|
||||
self::assertEquals($useUploadTempDirectoryValue, $result);
|
||||
}
|
||||
}
|
||||
}
|
86
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/FontTest.php
vendored
Normal file
86
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/FontTest.php
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Shared;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Font;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FontTest extends TestCase
|
||||
{
|
||||
public function testGetAutoSizeMethod()
|
||||
{
|
||||
$expectedResult = Font::AUTOSIZE_METHOD_APPROX;
|
||||
|
||||
$result = Font::getAutoSizeMethod();
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testSetAutoSizeMethod()
|
||||
{
|
||||
$autosizeMethodValues = [
|
||||
Font::AUTOSIZE_METHOD_EXACT,
|
||||
Font::AUTOSIZE_METHOD_APPROX,
|
||||
];
|
||||
|
||||
foreach ($autosizeMethodValues as $autosizeMethodValue) {
|
||||
$result = Font::setAutoSizeMethod($autosizeMethodValue);
|
||||
self::assertTrue($result);
|
||||
}
|
||||
}
|
||||
|
||||
public function testSetAutoSizeMethodWithInvalidValue()
|
||||
{
|
||||
$unsupportedAutosizeMethod = 'guess';
|
||||
|
||||
$result = Font::setAutoSizeMethod($unsupportedAutosizeMethod);
|
||||
self::assertFalse($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerFontSizeToPixels
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testFontSizeToPixels($expectedResult, ...$args)
|
||||
{
|
||||
$result = Font::fontSizeToPixels(...$args);
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerFontSizeToPixels()
|
||||
{
|
||||
return require 'data/Shared/FontSizeToPixels.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerInchSizeToPixels
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testInchSizeToPixels($expectedResult, ...$args)
|
||||
{
|
||||
$result = Font::inchSizeToPixels(...$args);
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerInchSizeToPixels()
|
||||
{
|
||||
return require 'data/Shared/InchSizeToPixels.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCentimeterSizeToPixels
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testCentimeterSizeToPixels($expectedResult, ...$args)
|
||||
{
|
||||
$result = Font::centimeterSizeToPixels(...$args);
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerCentimeterSizeToPixels()
|
||||
{
|
||||
return require 'data/Shared/CentimeterSizeToPixels.php';
|
||||
}
|
||||
}
|
25
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/PasswordHasherTest.php
vendored
Normal file
25
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/PasswordHasherTest.php
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Shared;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\PasswordHasher;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class PasswordHasherTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider providerHashPassword
|
||||
*
|
||||
* @param mixed $expectedResult
|
||||
*/
|
||||
public function testHashPassword($expectedResult, ...$args)
|
||||
{
|
||||
$result = PasswordHasher::hashPassword(...$args);
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerHashPassword()
|
||||
{
|
||||
return require 'data/Shared/PasswordHashes.php';
|
||||
}
|
||||
}
|
100
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php
vendored
Normal file
100
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Shared;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class StringHelperTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
// Reset Currency Code
|
||||
StringHelper::setCurrencyCode(null);
|
||||
}
|
||||
|
||||
public function testGetIsIconvEnabled()
|
||||
{
|
||||
$result = StringHelper::getIsIconvEnabled();
|
||||
self::assertTrue($result);
|
||||
}
|
||||
|
||||
public function testGetDecimalSeparator()
|
||||
{
|
||||
$localeconv = localeconv();
|
||||
|
||||
$expectedResult = (!empty($localeconv['decimal_point'])) ? $localeconv['decimal_point'] : ',';
|
||||
$result = StringHelper::getDecimalSeparator();
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testSetDecimalSeparator()
|
||||
{
|
||||
$expectedResult = ',';
|
||||
StringHelper::setDecimalSeparator($expectedResult);
|
||||
|
||||
$result = StringHelper::getDecimalSeparator();
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testGetThousandsSeparator()
|
||||
{
|
||||
$localeconv = localeconv();
|
||||
|
||||
$expectedResult = (!empty($localeconv['thousands_sep'])) ? $localeconv['thousands_sep'] : ',';
|
||||
$result = StringHelper::getThousandsSeparator();
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testSetThousandsSeparator()
|
||||
{
|
||||
$expectedResult = ' ';
|
||||
StringHelper::setThousandsSeparator($expectedResult);
|
||||
|
||||
$result = StringHelper::getThousandsSeparator();
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testGetCurrencyCode()
|
||||
{
|
||||
$localeconv = localeconv();
|
||||
$expectedResult = (!empty($localeconv['currency_symbol']) ? $localeconv['currency_symbol'] : (!empty($localeconv['int_curr_symbol']) ? $localeconv['int_curr_symbol'] : '$'));
|
||||
$result = StringHelper::getCurrencyCode();
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testSetCurrencyCode()
|
||||
{
|
||||
$expectedResult = '£';
|
||||
StringHelper::setCurrencyCode($expectedResult);
|
||||
|
||||
$result = StringHelper::getCurrencyCode();
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testControlCharacterPHP2OOXML()
|
||||
{
|
||||
$expectedResult = 'foo_x000B_bar';
|
||||
$result = StringHelper::controlCharacterPHP2OOXML('foo' . chr(11) . 'bar');
|
||||
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testControlCharacterOOXML2PHP()
|
||||
{
|
||||
$expectedResult = 'foo' . chr(11) . 'bar';
|
||||
$result = StringHelper::controlCharacterOOXML2PHP('foo_x000B_bar');
|
||||
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testSYLKtoUTF8()
|
||||
{
|
||||
$expectedResult = 'foo' . chr(11) . 'bar';
|
||||
$result = StringHelper::SYLKtoUTF8("foo\x1B ;bar");
|
||||
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
}
|
32
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/TimeZoneTest.php
vendored
Normal file
32
inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/TimeZoneTest.php
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Shared;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\TimeZone;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class TimeZoneTest extends TestCase
|
||||
{
|
||||
public function testSetTimezone()
|
||||
{
|
||||
$timezoneValues = [
|
||||
'Europe/Prague',
|
||||
'Asia/Tokyo',
|
||||
'America/Indiana/Indianapolis',
|
||||
'Pacific/Honolulu',
|
||||
'Atlantic/St_Helena',
|
||||
];
|
||||
|
||||
foreach ($timezoneValues as $timezoneValue) {
|
||||
$result = TimeZone::setTimezone($timezoneValue);
|
||||
self::assertTrue($result);
|
||||
}
|
||||
}
|
||||
|
||||
public function testSetTimezoneWithInvalidValue()
|
||||
{
|
||||
$unsupportedTimezone = 'Etc/GMT+10';
|
||||
$result = TimeZone::setTimezone($unsupportedTimezone);
|
||||
self::assertFalse($result);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user