File tree 7 files changed +29
-9
lines changed
7 files changed +29
-9
lines changed Original file line number Diff line number Diff line change 4
4
/node_modules
5
5
6
6
/.php_cs.cache
7
+
8
+ php-cs-fixer.phar
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ matrix:
24
24
- php : ' 7.4'
25
25
env : YAML=^5.0
26
26
- php : nightly
27
- env : YAML=~4.3 .0
27
+ env : YAML=~4.4 .0
28
28
# windows tests
29
29
# https://travis-ci.community/t/where-to-contribute-php-support-for-windows/304
30
30
- os : windows
@@ -57,6 +57,6 @@ script:
57
57
- make lint
58
58
- make stan
59
59
- make test
60
- - if [[ $TRAVIS_PHP_VERSION = "7.3" || $TRAVIS_PHP_VERSION = "nightly" ]]; then true; else make check-style; fi
60
+ - make check-style
61
61
- make coverage
62
62
Original file line number Diff line number Diff line change 8
8
9
9
all :
10
10
11
- check-style :
12
- vendor/bin/ php-cs-fixer fix src/ --diff --dry-run
11
+ check-style : php-cs-fixer.phar
12
+ PHP_CS_FIXER_IGNORE_ENV=1 ./ php-cs-fixer.phar fix src/ --diff --dry-run
13
13
14
14
fix-style :
15
15
vendor/bin/indent --tabs composer.json
@@ -42,6 +42,8 @@ schemas/openapi-v3.0.json: vendor/oai/openapi-specification/schemas/v3.0/schema.
42
42
schemas/openapi-v3.0.yaml : vendor/oai/openapi-specification/schemas/v3.0/schema.yaml
43
43
cp $< $@
44
44
45
+ php-cs-fixer.phar :
46
+ wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.16.7/php-cs-fixer.phar && chmod +x php-cs-fixer.phar
45
47
46
48
# find spec classes that are not mentioned in tests with @covers yet
47
49
coverage : .php-openapi-covA .php-openapi-covB
Original file line number Diff line number Diff line change 25
25
},
26
26
"require-dev" : {
27
27
"cebe/indent" : " *" ,
28
- "friendsofphp/php-cs-fixer" : " ~2.16.1" ,
29
- "phpunit/phpunit" : " ^6.5" ,
28
+ "phpunit/phpunit" : " ^6.5 || ^7.5 || ^8.5 || ^9.4" ,
30
29
31
30
"oai/openapi-specification" : " 3.0.2" ,
32
31
"mermade/openapi3-examples" : " 1.0.0" ,
Original file line number Diff line number Diff line change @@ -112,7 +112,13 @@ public function testSymfonyYamlBugHunt()
112
112
$ openapi = \cebe \openapi \Reader::readFromYamlFile ($ openApiFile );
113
113
114
114
$ inlineYamlExample = $ openapi ->paths ['/ ' ]->get ->responses ['200 ' ]->content ['application/json ' ]->example ;
115
- $ this ->assertInternalType ('array ' , $ inlineYamlExample );
115
+
116
+ if (method_exists ($ this , 'assertIsArray ' )) {
117
+ $ this ->assertIsArray ($ inlineYamlExample );
118
+ } else {
119
+ $ this ->assertInternalType ('array ' , $ inlineYamlExample );
120
+ }
121
+
116
122
$ expectedArray = json_decode (<<<JSON
117
123
{
118
124
"total": 2,
Original file line number Diff line number Diff line change @@ -46,7 +46,13 @@ public function testRead()
46
46
$ this ->assertTrue ($ result );
47
47
48
48
$ this ->assertInstanceOf (Reference::class, $ mediaType ->schema );
49
- $ this ->assertInternalType ('array ' , $ mediaType ->examples );
49
+
50
+ if (method_exists ($ this , 'assertIsArray ' )) {
51
+ $ this ->assertIsArray ($ mediaType ->examples );
52
+ } else {
53
+ $ this ->assertInternalType ('array ' , $ mediaType ->examples );
54
+ }
55
+
50
56
$ this ->assertCount (3 , $ mediaType ->examples );
51
57
$ this ->assertArrayHasKey ('cat ' , $ mediaType ->examples );
52
58
$ this ->assertArrayHasKey ('dog ' , $ mediaType ->examples );
Original file line number Diff line number Diff line change @@ -52,7 +52,12 @@ public function testReadPetStore()
52
52
53
53
54
54
// servers
55
- $ this ->assertInternalType ('array ' , $ openapi ->servers );
55
+ if (method_exists ($ this , 'assertIsArray ' )) {
56
+ $ this ->assertIsArray ($ openapi ->servers );
57
+ } else {
58
+ $ this ->assertInternalType ('array ' , $ openapi ->servers );
59
+ }
60
+
56
61
$ this ->assertCount (1 , $ openapi ->servers );
57
62
foreach ($ openapi ->servers as $ server ) {
58
63
$ this ->assertInstanceOf (\cebe \openapi \spec \Server::class, $ server );
You can’t perform that action at this time.
0 commit comments