Skip to content

Commit 98a08ba

Browse files
committed
fix: php build failing
1 parent cd71267 commit 98a08ba

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

.github/workflows/sdk-build-validation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ jobs:
173173
;;
174174
php)
175175
composer install
176+
composer test
176177
;;
177178
python)
178179
pip install -e .

src/SDK/Language/PHP.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ public function getFiles(): array
172172
'destination' => 'composer.json',
173173
'template' => 'php/composer.json.twig',
174174
],
175+
[
176+
'scope' => 'default',
177+
'destination' => 'phpunit.xml',
178+
'template' => 'php/phpunit.xml.twig',
179+
],
175180
[
176181
'scope' => 'service',
177182
'destination' => 'docs/{{service.name | caseLower}}.md',

templates/php/composer.json.twig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"url": "{{ spec.contactURL }}",
88
"email": "{{ spec.contactEmail }}"
99
},
10+
"scripts": {
11+
"test": "vendor/bin/phpunit"
12+
},
1013
"autoload": {
1114
"psr-4": {
1215
"{{spec.title | caseUcfirst}}\\": "src/{{spec.title | caseUcfirst}}"
@@ -19,7 +22,7 @@
1922
},
2023
"require-dev": {
2124
"phpunit/phpunit": "^10",
22-
"mockery/mockery": "^1.6.6"
25+
"mockery/mockery": "^1.6.12"
2326
},
2427
"minimum-stability": "dev"
2528
}

templates/php/phpunit.xml.twig

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
5+
bootstrap="vendor/autoload.php"
6+
cacheDirectory=".phpunit.cache"
7+
colors="true"
8+
displayDetailsOnIncompleteTests="true"
9+
displayDetailsOnSkippedTests="true"
10+
displayDetailsOnTestsThatTriggerDeprecations="true"
11+
displayDetailsOnTestsThatTriggerErrors="true"
12+
displayDetailsOnTestsThatTriggerNotices="true"
13+
displayDetailsOnTestsThatTriggerWarnings="true"
14+
failOnDeprecation="true"
15+
failOnEmptyTestSuite="true"
16+
failOnIncomplete="true"
17+
failOnRisky="true"
18+
failOnSkipped="true"
19+
failOnWarning="true"
20+
>
21+
<testsuites>
22+
<testsuite name="{{ spec.title | caseUcfirst }} SDK Test Suite">
23+
<directory>./tests/</directory>
24+
</testsuite>
25+
</testsuites>
26+
27+
<source>
28+
<include>
29+
<directory suffix=".php">./src/{{ spec.title | caseUcfirst }}</directory>
30+
</include>
31+
</source>
32+
</phpunit>

0 commit comments

Comments
 (0)