Skip to content

Commit dc176e6

Browse files
committed
Finish Unneeded Separate Processes
1 parent 908a70b commit dc176e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+63
-96
lines changed

src/PhpWord/Settings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ public static function restoreDefaults(): void
537537
self::$defaultFontName = self::DEFAULT_FONT_NAME;
538538
self::$defaultFontSize = self::DEFAULT_FONT_SIZE;
539539
self::$defaultPaper = self::DEFAULT_PAPER;
540+
self::$defaultRtl = null;
540541
self::$measurementUnit = self::UNIT_TWIP;
541542
self::$outputEscapingEnabled = false;
542543
self::$pdfRendererName = null;

tests/PhpWordTests/AbstractWebServerEmbedded.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected static function getRemoteImageUrl()
5151
return self::getBaseUrl() . '/images/new-php-logo.png';
5252
}
5353

54-
return 'http://php.net/images/logos/new-php-logo.png';
54+
return 'https://www.php.net/images/logos/new-php-logo.png';
5555
}
5656

5757
protected static function getRemoteImageUrlWithoutExtension(): string
@@ -69,7 +69,7 @@ protected static function getRemoteGifImageUrl()
6969
return self::getBaseUrl() . '/images/mario.gif';
7070
}
7171

72-
return 'http://php.net/images/logos/php-med-trans-light.gif';
72+
return 'https://www.php.net/images/logos/php-med-trans-light.gif';
7373
}
7474

7575
protected static function getRemoteBmpImageUrl()
@@ -78,6 +78,6 @@ protected static function getRemoteBmpImageUrl()
7878
return self::getBaseUrl() . '/images/duke_nukem.bmp';
7979
}
8080

81-
return 'https://samples.libav.org/image-samples/RACECAR.BMP';
81+
return 'https://examplefiles.org/files/images/bmp-example-file-download-500x500.bmp';
8282
}
8383
}

tests/PhpWordTests/Element/FooterTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public function testAddImage(): void
113113

114114
/**
115115
* Add image by URL.
116+
* Method getRemoteGifImageUrl seems to require separate process.
116117
*
117118
* @runInSeparateProcess
118119
*/

tests/PhpWordTests/Element/HeaderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public function testAddImage(): void
123123

124124
/**
125125
* Add image by URL.
126+
* Method getRemoteGifImageUrl seems to require separate process.
126127
*
127128
* @runInSeparateProcess
128129
*/

tests/PhpWordTests/PhpWordTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class PhpWordTest extends \PHPUnit\Framework\TestCase
3535
*/
3636
protected function tearDown(): void
3737
{
38+
Style::resetStyles();
3839
Settings::restoreDefaults();
3940
}
4041

tests/PhpWordTests/Reader/Word2007/StyleTableTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,21 @@
2020

2121
use PhpOffice\PhpWord\Element\Table;
2222
use PhpOffice\PhpWord\Reader\Word2007 as DocxReader;
23+
use PhpOffice\PhpWord\Settings;
2324
use PhpOffice\PhpWord\Style;
2425
use PhpOffice\PhpWord\Style\Table as TableStyle;
2526

2627
/**
2728
* Test class for PhpOffice\PhpWord\Reader\Word2007\Styles.
28-
* Run in separate process because doc changes default font.
2929
*/
3030
class StyleTableTest extends \PHPUnit\Framework\TestCase
3131
{
32+
// Reading this doc changes default font.
33+
protected function tearDown(): void
34+
{
35+
Settings::restoreDefaults();
36+
}
37+
3238
/**
3339
* Test reading of table layout.
3440
*/

tests/PhpWordTests/SettingsRtlTest.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,10 @@
3131
*/
3232
class SettingsRtlTest extends TestCase
3333
{
34-
/** @var bool */
35-
private $defaultRtl;
36-
37-
protected function setUp(): void
38-
{
39-
$this->defaultRtl = Settings::isDefaultRtl();
40-
}
41-
4234
protected function tearDown(): void
4335
{
44-
Settings::setDefaultRtl($this->defaultRtl);
36+
Settings::restoreDefaults();
37+
Style::resetStyles();
4538
}
4639

4740
public function testSetGetDefaultRtl(): void

tests/PhpWordTests/Style/AbstractStyleTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
/**
2828
* Test class for PhpOffice\PhpWord\Style\AbstractStyle.
29-
*
30-
* @runTestsInSeparateProcesses
3129
*/
3230
class AbstractStyleTest extends \PHPUnit\Framework\TestCase
3331
{

tests/PhpWordTests/Style/CellTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
* Test class for PhpOffice\PhpWord\Style\Cell.
2626
*
2727
* @coversDefaultClass \PhpOffice\PhpWord\Style\Cell
28-
*
29-
* @runTestsInSeparateProcesses
3028
*/
3129
class CellTest extends \PHPUnit\Framework\TestCase
3230
{

tests/PhpWordTests/Style/ChartTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
* Test class for PhpOffice\PhpWord\Style\Chart.
2525
*
2626
* @coversDefaultClass \PhpOffice\PhpWord\Style\Chart
27-
*
28-
* @runTestsInSeparateProcesses
2927
*/
3028
class ChartTest extends \PHPUnit\Framework\TestCase
3129
{

0 commit comments

Comments
 (0)