@@ -179,17 +179,15 @@ public function testTitleStyles(): void
179179 $ xpath = new DOMXPath ($ dom );
180180
181181 $ style = Helper::getTextContent ($ xpath , '/html/head/style ' );
182- // self::assertNotFalse(strpos($style, 'h1 {font-family: \'Calibri\'; font-weight: bold;}'));
182+ self ::assertNotFalse (strpos ($ style , 'h1 {font-family: \'Calibri \'; font-weight: bold;} ' ));
183183 self ::assertNotFalse (strpos ($ style , 'h1 {margin-top: 0.5pt; margin-bottom: 0.5pt;} ' ));
184- // self::assertNotFalse(strpos($style, 'h2 {font-family: \'Times New Roman\'; font-style: italic;}'));
184+ self ::assertNotFalse (strpos ($ style , 'h2 {font-family: \'Times New Roman \'; font-style: italic;} ' ));
185185 self ::assertNotFalse (strpos ($ style , 'h2 {margin-top: 0.25pt; margin-bottom: 0.25pt;} ' ));
186186 self ::assertEquals (1 , Helper::getLength ($ xpath , '/html/body/div/h1 ' ));
187187 self ::assertEquals (2 , Helper::getLength ($ xpath , '/html/body/div/h2 ' ));
188- // code for getNamedItem had been erroneous
189- self ::assertSame ("font-family: 'Calibri'; font-weight: bold; " , Helper::getNamedItem ($ xpath , '/html/body/div/h1 ' , 'style ' )->textContent );
190188 $ html = Helper::getHtmlString ($ phpWord );
191- self ::assertStringContainsString ('<h1 style="font-family: \' Calibri \' ; font-weight: bold;" >Header 1 #1</h1> ' , $ html );
192- self ::assertStringContainsString ('<h2 style="font-family: \' Times New Roman \' ; font-style: italic;" >Header 2 #1</h2> ' , $ html );
193- self ::assertStringContainsString ('<h2 style="font-family: \' Times New Roman \' ; font-style: italic;" >Header 2 #2</h2> ' , $ html );
189+ self ::assertStringContainsString ('<h1>Header 1 #1</h1> ' , $ html );
190+ self ::assertStringContainsString ('<h2>Header 2 #1</h2> ' , $ html );
191+ self ::assertStringContainsString ('<h2>Header 2 #2</h2> ' , $ html );
194192 }
195193}
0 commit comments