Skip to content

Commit 3dd5da5

Browse files
committed
Trying FontTest One More Time Before Giving Up
1 parent e9316c0 commit 3dd5da5

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

tests/PhpWordTests/Writer/HTML/FontTest.php

+21-21
Original file line numberDiff line numberDiff line change
@@ -87,27 +87,27 @@ public function testFontNames1(): void
8787
$style = Helper::getTextContent($xpath, '/html/head/style');
8888
$prg = preg_match('/^body[^\\r\\n]*/m', $style, $matches);
8989
self::assertNotEmpty($matches);
90-
self::assertSame(1, $prg);
90+
self::assertNotFalse($prg);
9191
self::assertEquals('body {font-family: \'Courier New\'; font-size: 12pt;}', $matches[0]);
9292
$prg = preg_match('/^[.]style1[^\\r\\n]*/m', $style, $matches);
9393
self::assertNotEmpty($matches);
94-
self::assertSame(1, $prg);
94+
self::assertNotFalse($prg);
9595
self::assertEquals('.style1 {font-family: \'Tahoma\'; font-size: 10pt; color: #1B2232; font-weight: bold;}', $matches[0]);
9696
$prg = preg_match('/^[.]style2[^\\r\\n]*/m', $style, $matches);
9797
self::assertNotEmpty($matches);
98-
self::assertSame(1, $prg);
98+
self::assertNotFalse($prg);
9999
self::assertEquals('.style2 {font-family: \'Arial\'; font-size: 10pt;}', $matches[0]);
100100
$prg = preg_match('/^[.]style3[^\\r\\n]*/m', $style, $matches);
101101
self::assertNotEmpty($matches);
102-
self::assertSame(1, $prg);
102+
self::assertNotFalse($prg);
103103
self::assertEquals('.style3 {font-family: \'hack attempt'}; display:none\'; font-size: 10pt;}', $matches[0]);
104104
$prg = preg_match('/^[.]style4[^\\r\\n]*/m', $style, $matches);
105105
self::assertNotEmpty($matches);
106-
self::assertSame(1, $prg);
106+
self::assertNotFalse($prg);
107107
self::assertEquals('.style4 {font-family: \'padmaa 1.1\'; font-size: 10pt; font-weight: bold;}', $matches[0]);
108108
$prg = preg_match('/^[.]style5[^\\r\\n]*/m', $style, $matches);
109109
self::assertNotEmpty($matches);
110-
self::assertSame(1, $prg);
110+
self::assertNotFalse($prg);
111111
self::assertEquals('.style5 {font-family: \'MingLiU-ExtB\'; font-size: 10pt; font-weight: bold;}', $matches[0]);
112112
}
113113

@@ -143,23 +143,23 @@ public function testFontNames2(): void
143143
$style = Helper::getTextContent($xpath, '/html/head/style');
144144
$prg = preg_match('/^body[^\\r\\n]*/m', $style, $matches);
145145
self::assertNotEmpty($matches);
146-
self::assertSame(1, $prg);
146+
self::assertNotFalse($prg);
147147
self::assertEquals('body {font-family: \'Courier New\'; font-size: 12pt;}', $matches[0]);
148148
$prg = preg_match('/^[.]style1[^\\r\\n]*/m', $style, $matches);
149149
self::assertNotEmpty($matches);
150-
self::assertSame(1, $prg);
150+
self::assertNotFalse($prg);
151151
self::assertEquals('.style1 {font-family: \'Tahoma\'; font-size: 10pt; color: #1B2232; font-weight: bold;}', $matches[0]);
152-
self::assertNotEmpty($matches);
153152
$prg = preg_match('/^[.]style2[^\\r\\n]*/m', $style, $matches);
154-
self::assertSame(1, $prg);
153+
self::assertNotEmpty($matches);
154+
self::assertNotFalse($prg);
155155
self::assertEquals('.style2 {font-family: \'Arial\', sans-serif; font-size: 10pt;}', $matches[0]);
156156
$prg = preg_match('/^[.]style3[^\\r\\n]*/m', $style, $matches);
157157
self::assertNotEmpty($matches);
158-
self::assertSame(1, $prg);
158+
self::assertNotFalse($prg);
159159
self::assertEquals('.style3 {font-family: \'DejaVu Sans Monospace\', monospace; font-size: 10pt;}', $matches[0]);
160160
$prg = preg_match('/^[.]style4[^\\r\\n]*/m', $style, $matches);
161161
self::assertNotEmpty($matches);
162-
self::assertSame(1, $prg);
162+
self::assertNotFalse($prg);
163163
self::assertEquals('.style4 {font-family: \'Arial\'; font-size: 10pt;}', $matches[0]);
164164
}
165165

@@ -195,23 +195,23 @@ public function testFontNames3(): void
195195
$style = Helper::getTextContent($xpath, '/html/head/style');
196196
$prg = preg_match('/^body[^\\r\\n]*/m', $style, $matches);
197197
self::assertNotEmpty($matches);
198-
self::assertSame(1, $prg);
198+
self::assertNotFalse($prg);
199199
self::assertEquals('body {font-family: \'Courier New\', monospace; font-size: 12pt;}', $matches[0]);
200200
$prg = preg_match('/^[.]style1[^\\r\\n]*/m', $style, $matches);
201201
self::assertNotEmpty($matches);
202-
self::assertSame(1, $prg);
202+
self::assertNotFalse($prg);
203203
self::assertEquals('.style1 {font-family: \'Tahoma\'; font-size: 10pt; color: #1B2232; font-weight: bold;}', $matches[0]);
204204
$prg = preg_match('/^[.]style2[^\\r\\n]*/m', $style, $matches);
205205
self::assertNotEmpty($matches);
206-
self::assertSame(1, $prg);
206+
self::assertNotFalse($prg);
207207
self::assertEquals('.style2 {font-family: \'Arial\', sans-serif; font-size: 10pt;}', $matches[0]);
208208
$prg = preg_match('/^[.]style3[^\\r\\n]*/m', $style, $matches);
209209
self::assertNotEmpty($matches);
210-
self::assertSame(1, $prg);
210+
self::assertNotFalse($prg);
211211
self::assertEquals('.style3 {font-family: \'DejaVu Sans Monospace\', monospace; font-size: 10pt;}', $matches[0]);
212212
$prg = preg_match('/^[.]style4[^\\r\\n]*/m', $style, $matches);
213213
self::assertNotEmpty($matches);
214-
self::assertSame(1, $prg);
214+
self::assertNotFalse($prg);
215215
self::assertEquals('.style4 {font-family: \'Arial\'; font-size: 10pt;}', $matches[0]);
216216
}
217217

@@ -242,19 +242,19 @@ public function testWhiteSpace(): void
242242
self::assertEquals('body {font-family: \'Arial\'; font-size: 12pt; white-space: pre-wrap;}', $matches[0]);
243243
$prg = preg_match('/^[.]style1[^\\r\\n]*/m', $style, $matches);
244244
self::assertNotEmpty($matches);
245-
self::assertSame(1, $prg);
245+
self::assertNotFalse($prg);
246246
self::assertEquals('.style1 {font-family: \'Courier New\'; font-size: 10pt; white-space: pre-wrap;}', $matches[0]);
247247
$prg = preg_match('/^[.]style2[^\\r\\n]*/m', $style, $matches);
248248
self::assertNotEmpty($matches);
249-
self::assertSame(1, $prg);
249+
self::assertNotFalse($prg);
250250
self::assertEquals('.style2 {font-family: \'Courier New\'; font-size: 10pt;}', $matches[0]);
251251
$prg = preg_match('/^[.]style3[^\\r\\n]*/m', $style, $matches);
252252
self::assertNotEmpty($matches);
253-
self::assertSame(1, $prg);
253+
self::assertNotFalse($prg);
254254
self::assertEquals('.style3 {font-family: \'Courier New\'; font-size: 10pt; white-space: normal;}', $matches[0]);
255255
$prg = preg_match('/^[.]style4[^\\r\\n]*/m', $style, $matches);
256256
self::assertNotEmpty($matches);
257-
self::assertSame(1, $prg);
257+
self::assertNotFalse($prg);
258258
self::assertEquals('.style4 {font-family: \'Courier New\'; font-size: 10pt;}', $matches[0]);
259259
}
260260

0 commit comments

Comments
 (0)