2012-11-20 23:55:18 +00:00
|
|
|
<?php
|
|
|
|
|
2016-08-31 17:18:12 +00:00
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Shared;
|
2012-11-20 23:55:18 +00:00
|
|
|
|
2016-08-31 17:18:12 +00:00
|
|
|
use PhpOffice\PhpSpreadsheet\Shared\File;
|
2017-05-17 22:02:17 +00:00
|
|
|
use PHPUnit_Framework_TestCase;
|
2016-08-14 04:08:43 +00:00
|
|
|
|
2017-05-17 22:02:17 +00:00
|
|
|
class FileTest extends PHPUnit_Framework_TestCase
|
2012-11-20 23:55:18 +00:00
|
|
|
{
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testGetUseUploadTempDirectory()
|
|
|
|
{
|
2015-05-17 16:34:30 +00:00
|
|
|
$expectedResult = false;
|
2015-05-17 13:00:02 +00:00
|
|
|
|
2016-08-26 06:39:29 +00:00
|
|
|
$result = File::getUseUploadTempDirectory();
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testSetUseUploadTempDirectory()
|
|
|
|
{
|
2016-08-16 15:33:57 +00:00
|
|
|
$useUploadTempDirectoryValues = [
|
2015-05-17 13:00:02 +00:00
|
|
|
true,
|
|
|
|
false,
|
2016-08-16 15:33:57 +00:00
|
|
|
];
|
2015-05-17 13:00:02 +00:00
|
|
|
|
|
|
|
foreach ($useUploadTempDirectoryValues as $useUploadTempDirectoryValue) {
|
2016-08-26 06:39:29 +00:00
|
|
|
File::setUseUploadTempDirectory($useUploadTempDirectoryValue);
|
2015-05-17 13:00:02 +00:00
|
|
|
|
2016-08-26 06:39:29 +00:00
|
|
|
$result = File::getUseUploadTempDirectory();
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($useUploadTempDirectoryValue, $result);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
|
|
|
}
|
2012-11-20 23:55:18 +00:00
|
|
|
}
|