Skip to content

Commit c53ae09

Browse files
committed
CI: Added ODFValidator
1 parent e7fa00f commit c53ae09

File tree

15 files changed

+255
-109
lines changed

15 files changed

+255
-109
lines changed

.github/workflows/validator.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Validator
2+
on: [push, pull_request]
3+
jobs:
4+
odf:
5+
name: ODF Validator
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Setup PHP
9+
uses: shivammathur/setup-php@v2
10+
with:
11+
php-version: '8.4'
12+
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
13+
- uses: actions/checkout@v2
14+
15+
- name: Composer Install
16+
run: composer install --ansi --prefer-dist --no-interaction --no-progress
17+
18+
- name: Generate samples files
19+
run: composer run samples
20+
21+
- name: Download ODFValidator
22+
run: wget https://repo1.maven.org/maven2/org/odftoolkit/odfvalidator/0.12.0/odfvalidator-0.12.0-jar-with-dependencies.jar -O odfvalidator.jar
23+
24+
# https://odftoolkit.org/conformance/ODFValidator.html#what-is-checked
25+
- name: Validate documents (ODF 1.2)
26+
run: java -jar odfvalidator.jar -1.2 -e -r samples/results/ -x "^.*\/Sample_(04|22).*odp"
27+
## 04 & 22 excluded
28+
## Cause : src/PhpPresentation/Writer/ODPresentation/Content.php::writeTableStyle

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ php-cs-fixer.phar
1414
.phpunit.result.cache
1515
composer.phar
1616
vendor
17-
/batch_CI.bat
17+
/odfvalidator.jar
1818

1919
### Samples
2020
/samples/Sample_00_Test.php

docs/changes/1.2.0.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
- PowerPoint2007 Reader : Fixed loading of fonts by [@ag3202](https://github.com/ag3202) and [@Progi1984](https://github.com/Progi1984) in [#851](https://github.com/PHPOffice/PHPPresentation/pull/851)
2525

2626
## Miscellaneous
27+
- CI: Added ODFValidator by [@Progi1984](https://github.com/Progi1984) fixing [#678](https://github.com/PHPOffice/PHPWord/issues/678) in [#653](https://github.com/PHPOffice/PHPWord/pull/653)
2728

2829
## BC Breaks

samples/Sample_03_Image.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535

3636
// Add a file drawing (GIF) to the slide
3737
$shape = new Drawing\File();
38-
$shape->setName('Image File')
38+
$shape
39+
->setName('Image File')
3940
->setDescription('Image File')
4041
->setPath(__DIR__ . '/resources/phppowerpoint_logo.gif')
4142
->setHeight(36)

samples/Sample_Header.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
*
116116
* @return string
117117
*/
118-
function write($phpPresentation, $filename, $writers)
118+
function write(PhpPresentation $phpPresentation, string $filename, array $writers): string
119119
{
120120
$result = '';
121121

0 commit comments

Comments
 (0)