2012-11-20 23:55:18 +00:00
|
|
|
<?php
|
|
|
|
|
2016-08-25 04:53:15 +00:00
|
|
|
namespace PhpSpreadsheetTests\Shared;
|
2012-11-20 23:55:18 +00:00
|
|
|
|
2016-08-16 14:24:47 +00:00
|
|
|
use PhpSpreadsheet\Shared\File;
|
2016-08-14 04:08:43 +00:00
|
|
|
|
2016-03-22 14:35:50 +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();
|
2015-05-17 13:00:02 +00:00
|
|
|
$this->assertEquals($expectedResult, $result);
|
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
2015-05-17 13:00:02 +00:00
|
|
|
$this->assertEquals($useUploadTempDirectoryValue, $result);
|
|
|
|
}
|
|
|
|
}
|
2012-11-20 23:55:18 +00:00
|
|
|
}
|