|
24 | 24 | * Test class for PhpOffice\PhpWord\Settings. |
25 | 25 | * |
26 | 26 | * @coversDefaultClass \PhpOffice\PhpWord\Settings |
27 | | - * |
28 | | - * @runTestsInSeparateProcesses |
29 | 27 | */ |
30 | 28 | class SettingsTest extends TestCase |
31 | 29 | { |
32 | | - private $compatibility; |
33 | | - |
34 | | - /** @var string */ |
35 | | - private $defaultFontColor; |
36 | | - |
37 | | - private $defaultFontSize; |
38 | | - |
39 | | - private $defaultFontName; |
40 | | - |
41 | | - private $defaultPaper; |
42 | | - |
43 | | - private $measurementUnit; |
44 | | - |
45 | | - private $outputEscapingEnabled; |
46 | | - |
47 | | - private $pdfRendererName; |
48 | | - |
49 | | - /** |
50 | | - * @var array |
51 | | - */ |
52 | | - private $pdfRendererOptions; |
53 | | - |
54 | | - private $pdfRendererPath; |
55 | | - |
56 | | - private $tempDir; |
57 | | - |
58 | | - private $zipClass; |
59 | | - |
60 | | - protected function setUp(): void |
61 | | - { |
62 | | - $this->compatibility = Settings::hasCompatibility(); |
63 | | - $this->defaultFontColor = Settings::getDefaultFontColor(); |
64 | | - $this->defaultFontSize = Settings::getDefaultFontSize(); |
65 | | - $this->defaultFontName = Settings::getDefaultFontName(); |
66 | | - $this->defaultPaper = Settings::getDefaultPaper(); |
67 | | - $this->measurementUnit = Settings::getMeasurementUnit(); |
68 | | - $this->outputEscapingEnabled = Settings::isOutputEscapingEnabled(); |
69 | | - $this->pdfRendererName = Settings::getPdfRendererName(); |
70 | | - $this->pdfRendererOptions = Settings::getPdfRendererOptions(); |
71 | | - $this->pdfRendererPath = Settings::getPdfRendererPath(); |
72 | | - $this->tempDir = Settings::getTempDir(); |
73 | | - $this->zipClass = Settings::getZipClass(); |
74 | | - } |
75 | | - |
76 | 30 | protected function tearDown(): void |
77 | 31 | { |
78 | | - Settings::setCompatibility($this->compatibility); |
79 | | - Settings::setDefaultFontColor($this->defaultFontColor); |
80 | | - Settings::setDefaultFontSize($this->defaultFontSize); |
81 | | - Settings::setDefaultFontName($this->defaultFontName); |
82 | | - Settings::setDefaultPaper($this->defaultPaper); |
83 | | - Settings::setMeasurementUnit($this->measurementUnit); |
84 | | - Settings::setOutputEscapingEnabled($this->outputEscapingEnabled); |
85 | | - Settings::setPdfRendererName($this->pdfRendererName); |
86 | | - Settings::setPdfRendererOptions($this->pdfRendererOptions); |
87 | | - Settings::setPdfRendererPath($this->pdfRendererPath); |
88 | | - Settings::setTempDir($this->tempDir); |
89 | | - Settings::setZipClass($this->zipClass); |
| 32 | + Settings::restoreDefaults(); |
90 | 33 | } |
91 | 34 |
|
92 | 35 | /** |
93 | 36 | * Test set/get compatibity option. |
94 | 37 | */ |
95 | 38 | public function testSetGetCompatibility(): void |
96 | 39 | { |
| 40 | + Settings::restoreDefaults(); |
97 | 41 | self::assertTrue(Settings::hasCompatibility()); |
98 | 42 | self::assertTrue(Settings::setCompatibility(false)); |
99 | 43 | self::assertFalse(Settings::hasCompatibility()); |
@@ -129,6 +73,7 @@ public function testSetGetZipClass(): void |
129 | 73 | public function testSetGetPdfRenderer(): void |
130 | 74 | { |
131 | 75 | $domPdfPath = realpath(PHPWORD_TESTS_BASE_DIR . '/../vendor/dompdf/dompdf'); |
| 76 | + self::assertNotFalse($domPdfPath); |
132 | 77 |
|
133 | 78 | self::assertFalse(Settings::setPdfRenderer('FOO', 'dummy/path')); |
134 | 79 | self::assertTrue(Settings::setPdfRenderer(Settings::PDF_RENDERER_DOMPDF, $domPdfPath)); |
|
0 commit comments