|
2 | 2 | /**
|
3 | 3 | * This file is part of PHPWord - A pure PHP library for reading and writing
|
4 | 4 | * word processing documents.
|
5 |
| - * |
6 | 5 | * PHPWord is free software distributed under the terms of the GNU Lesser
|
7 | 6 | * General Public License version 3 as published by the Free Software Foundation.
|
8 |
| - * |
9 | 7 | * For the full copyright and license information, please read the LICENSE
|
10 | 8 | * file that was distributed with this source code. For the full list of
|
11 | 9 | * contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
|
@@ -61,11 +59,11 @@ public function testWriteCustomProps(): void
|
61 | 59 | $doc = TestHelperDOCX::getDocument($phpWord);
|
62 | 60 | self::assertNotNull($doc);
|
63 | 61 |
|
64 |
| -// $this->assertTrue($doc->elementExists('/Properties/property[name="key1"]/vt:lpwstr')); |
65 |
| -// $this->assertTrue($doc->elementExists('/Properties/property[name="key2"]/vt:bool')); |
66 |
| -// $this->assertTrue($doc->elementExists('/Properties/property[name="key3"]/vt:i4')); |
67 |
| -// $this->assertTrue($doc->elementExists('/Properties/property[name="key4"]/vt:r8')); |
68 |
| -// $this->assertTrue($doc->elementExists('/Properties/property[name="key5"]/vt:lpwstr')); |
| 62 | + // $this->assertTrue($doc->elementExists('/Properties/property[name="key1"]/vt:lpwstr')); |
| 63 | + // $this->assertTrue($doc->elementExists('/Properties/property[name="key2"]/vt:bool')); |
| 64 | + // $this->assertTrue($doc->elementExists('/Properties/property[name="key3"]/vt:i4')); |
| 65 | + // $this->assertTrue($doc->elementExists('/Properties/property[name="key4"]/vt:r8')); |
| 66 | + // $this->assertTrue($doc->elementExists('/Properties/property[name="key5"]/vt:lpwstr')); |
69 | 67 | }
|
70 | 68 |
|
71 | 69 | /**
|
@@ -408,7 +406,13 @@ public function testWriteImage(): void
|
408 | 406 | // behind
|
409 | 407 | $element = $doc->getElement('/w:document/w:body/w:p[2]/w:r/w:pict/v:shape');
|
410 | 408 | $style = $element->getAttribute('style');
|
411 |
| - self::assertMatchesRegularExpression('/z\-index:\-[0-9]*/', $style); |
| 409 | + |
| 410 | + // Try to address CI coverage issue for PHP 7.1 and 7.2 when using regex match assertions |
| 411 | + if (method_exists(static::class, 'assertRegExp')) { |
| 412 | + self::assertRegExp('/z\-index:\-[0-9]*/', $style); |
| 413 | + } else { |
| 414 | + self::assertMatchesRegularExpression('/z\-index:\-[0-9]*/', $style); |
| 415 | + } |
412 | 416 |
|
413 | 417 | // square
|
414 | 418 | $element = $doc->getElement('/w:document/w:body/w:p[4]/w:r/w:pict/v:shape/w10:wrap');
|
@@ -551,7 +555,13 @@ public function testWriteDefaultColor(): void
|
551 | 555 | $cell->addText('Test');
|
552 | 556 |
|
553 | 557 | $doc = TestHelperDOCX::getDocument($phpWord);
|
554 |
| - self::assertEquals(Cell::DEFAULT_BORDER_COLOR, $doc->getElementAttribute('/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:top', 'w:color')); |
| 558 | + self::assertEquals( |
| 559 | + Cell::DEFAULT_BORDER_COLOR, |
| 560 | + $doc->getElementAttribute( |
| 561 | + '/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:top', |
| 562 | + 'w:color' |
| 563 | + ) |
| 564 | + ); |
555 | 565 | }
|
556 | 566 |
|
557 | 567 | /**
|
|
0 commit comments