Skip to content

Commit

Permalink
Trying FontTest One More Time Before Giving Up
Browse files Browse the repository at this point in the history
  • Loading branch information
oleibman committed Jan 10, 2025
1 parent e9316c0 commit 3dd5da5
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions tests/PhpWordTests/Writer/HTML/FontTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,27 @@ public function testFontNames1(): void
$style = Helper::getTextContent($xpath, '/html/head/style');
$prg = preg_match('/^body[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('body {font-family: \'Courier New\'; font-size: 12pt;}', $matches[0]);
$prg = preg_match('/^[.]style1[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style1 {font-family: \'Tahoma\'; font-size: 10pt; color: #1B2232; font-weight: bold;}', $matches[0]);
$prg = preg_match('/^[.]style2[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style2 {font-family: \'Arial\'; font-size: 10pt;}', $matches[0]);
$prg = preg_match('/^[.]style3[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style3 {font-family: \'hack attempt'}; display:none\'; font-size: 10pt;}', $matches[0]);
$prg = preg_match('/^[.]style4[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style4 {font-family: \'padmaa 1.1\'; font-size: 10pt; font-weight: bold;}', $matches[0]);
$prg = preg_match('/^[.]style5[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style5 {font-family: \'MingLiU-ExtB\'; font-size: 10pt; font-weight: bold;}', $matches[0]);
}

Expand Down Expand Up @@ -143,23 +143,23 @@ public function testFontNames2(): void
$style = Helper::getTextContent($xpath, '/html/head/style');
$prg = preg_match('/^body[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('body {font-family: \'Courier New\'; font-size: 12pt;}', $matches[0]);
$prg = preg_match('/^[.]style1[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style1 {font-family: \'Tahoma\'; font-size: 10pt; color: #1B2232; font-weight: bold;}', $matches[0]);
self::assertNotEmpty($matches);
$prg = preg_match('/^[.]style2[^\\r\\n]*/m', $style, $matches);
self::assertSame(1, $prg);
self::assertNotEmpty($matches);
self::assertNotFalse($prg);
self::assertEquals('.style2 {font-family: \'Arial\', sans-serif; font-size: 10pt;}', $matches[0]);
$prg = preg_match('/^[.]style3[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style3 {font-family: \'DejaVu Sans Monospace\', monospace; font-size: 10pt;}', $matches[0]);
$prg = preg_match('/^[.]style4[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style4 {font-family: \'Arial\'; font-size: 10pt;}', $matches[0]);
}

Expand Down Expand Up @@ -195,23 +195,23 @@ public function testFontNames3(): void
$style = Helper::getTextContent($xpath, '/html/head/style');
$prg = preg_match('/^body[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('body {font-family: \'Courier New\', monospace; font-size: 12pt;}', $matches[0]);
$prg = preg_match('/^[.]style1[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style1 {font-family: \'Tahoma\'; font-size: 10pt; color: #1B2232; font-weight: bold;}', $matches[0]);
$prg = preg_match('/^[.]style2[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style2 {font-family: \'Arial\', sans-serif; font-size: 10pt;}', $matches[0]);
$prg = preg_match('/^[.]style3[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style3 {font-family: \'DejaVu Sans Monospace\', monospace; font-size: 10pt;}', $matches[0]);
$prg = preg_match('/^[.]style4[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style4 {font-family: \'Arial\'; font-size: 10pt;}', $matches[0]);
}

Expand Down Expand Up @@ -242,19 +242,19 @@ public function testWhiteSpace(): void
self::assertEquals('body {font-family: \'Arial\'; font-size: 12pt; white-space: pre-wrap;}', $matches[0]);
$prg = preg_match('/^[.]style1[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style1 {font-family: \'Courier New\'; font-size: 10pt; white-space: pre-wrap;}', $matches[0]);
$prg = preg_match('/^[.]style2[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style2 {font-family: \'Courier New\'; font-size: 10pt;}', $matches[0]);
$prg = preg_match('/^[.]style3[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style3 {font-family: \'Courier New\'; font-size: 10pt; white-space: normal;}', $matches[0]);
$prg = preg_match('/^[.]style4[^\\r\\n]*/m', $style, $matches);
self::assertNotEmpty($matches);
self::assertSame(1, $prg);
self::assertNotFalse($prg);
self::assertEquals('.style4 {font-family: \'Courier New\'; font-size: 10pt;}', $matches[0]);
}

Expand Down

0 comments on commit 3dd5da5

Please sign in to comment.