Skip to content

Commit c548512

Browse files
author
MarkBaker
committed
use php://temp for writer tests
1 parent 8ce1386 commit c548512

File tree

8 files changed

+6
-33
lines changed

8 files changed

+6
-33
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
],
5353
"versions": [
5454
"phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PHPCompatibility --runtime-set testVersion 7.3- -n"
55+
],
56+
"bench": [
57+
"phpbench run tests/Performance/ --report=aggregate -n"
5558
]
5659
},
5760
"require": {

tests/Performance/Writer/AbstractBasicWriter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AbstractBasicWriter
1515
/**
1616
* @var string
1717
*/
18-
protected $fileName = 'performanceTestWrite.file';
18+
protected $fileName = 'php://temp';
1919

2020
public function __construct(int $columns = 32, int $rows = 512)
2121
{

tests/Performance/Writer/Html/HtmlWriterBenchmark.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
class HtmlWriterBenchmark extends AbstractBasicWriter
99
{
10-
/**
11-
* @var string
12-
*/
13-
protected $fileName = 'performanceTestWrite.html';
14-
1510
/**
1611
* @revs(5)
1712
* @Iterations(5)

tests/Performance/Writer/Ods/OdsWriterBenchmark.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
class OdsWriterBenchmark extends AbstractBasicWriter
99
{
10-
/**
11-
* @var string
12-
*/
13-
protected $fileName = 'performanceTestWrite.ods';
14-
1510
/**
1611
* @revs(5)
1712
* @Iterations(5)

tests/Performance/Writer/Xls/XlxWriterBenchmark.php renamed to tests/Performance/Writer/Xls/XlsWriterBenchmark.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@
55
use PhpOffice\PhpSpreadsheet\Writer\Xls;
66
use PhpOffice\PhpSpreadsheetPerformance\Writer\AbstractBasicWriter;
77

8-
class XlxWriterBenchmark extends AbstractBasicWriter
8+
class XlsWriterBenchmark extends AbstractBasicWriter
99
{
10-
/**
11-
* @var string
12-
*/
13-
protected $fileName = 'performanceTestWrite.xls';
14-
1510
/**
1611
* @revs(5)
1712
* @Iterations(5)

tests/Performance/Writer/Xls/XlsWriterLargeBenchmark.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,13 @@
55
use PhpOffice\PhpSpreadsheet\Writer\Xls;
66
use PhpOffice\PhpSpreadsheetPerformance\Writer\AbstractBasicWriter;
77

8-
class XlxWriterLargeBenchmark extends AbstractBasicWriter
8+
class XlsWriterLargeBenchmark extends AbstractBasicWriter
99
{
1010
public function __construct()
1111
{
1212
parent::__construct(128, 8192);
1313
}
1414

15-
/**
16-
* @var string
17-
*/
18-
protected $fileName = 'performanceTestWrite.xls';
19-
2015
/**
2116
* @Groups({"slow"})
2217
* @revs(3)

tests/Performance/Writer/Xlsx/XlsxWriterBenchmark.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
class XlsxWriterBenchmark extends AbstractBasicWriter
99
{
10-
/**
11-
* @var string
12-
*/
13-
protected $fileName = 'performanceTestWrite.xlsx';
14-
1510
/**
1611
* @revs(5)
1712
* @Iterations(5)

tests/Performance/Writer/Xlsx/XlsxWriterLargeBenchmark.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ public function __construct()
1212
parent::__construct(128, 8192);
1313
}
1414

15-
/**
16-
* @var string
17-
*/
18-
protected $fileName = 'performanceTestWrite.xlsx';
19-
2015
/**
2116
* @Groups({"slow"})
2217
* @revs(3)

0 commit comments

Comments
 (0)