Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit ec10b38

Browse files
committed
🛀 test suite overhaul (again)
1 parent 154eef3 commit ec10b38

File tree

118 files changed

+1452
-2454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1452
-2454
lines changed

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@
3131
"ext-simplexml": "*",
3232
"ext-sodium": "*",
3333
"ext-zlib": "*",
34-
"chillerlan/php-http-message-utils": "^2.1",
34+
"chillerlan/php-http-message-utils": "^2.2",
3535
"chillerlan/php-settings-container": "^3.2",
3636
"psr/http-client": "^1.0",
3737
"psr/http-message": "^1.1 || ^2.0",
3838
"psr/log": "^1.1 || ^2.0 || ^3.0"
3939
},
4040
"require-dev": {
4141
"chillerlan/php-dotenv": "^3.0",
42+
"chillerlan/phpunit-http": "^1.0",
4243
"guzzlehttp/guzzle": "^7.8",
4344
"monolog/monolog": "^3.5",
4445
"phan/phan": "^5.4",

phpunit.xml.dist

+23-8
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,20 @@
55
cacheDirectory=".build/phpunit.cache"
66
cacheResultFile=".build/phpunit.result.cache"
77
colors="true"
8+
beStrictAboutCoverageMetadata="true"
89
>
910
<testsuites>
10-
<testsuite name="php-oauth-core test suite">
11-
<directory>tests</directory>
12-
<exclude>tests/Helpers</exclude>
11+
<testsuite name="php-oauth-core">
12+
<directory>tests/Core</directory>
13+
</testsuite>
14+
<testsuite name="php-oauth-core token storage">
15+
<directory>tests/Core</directory>
16+
</testsuite>
17+
<testsuite name="php-oauth-providers unit tests">
18+
<directory>tests/Providers/Unit</directory>
19+
</testsuite>
20+
<testsuite name="php-oauth-providers live API tests">
21+
<directory>tests/Providers/Live</directory>
1322
</testsuite>
1423
</testsuites>
1524
<source>
@@ -23,18 +32,24 @@
2332
<xml outputDirectory=".build/coverage/coverage-xml"/>
2433
</report>
2534
</coverage>
35+
<groups>
36+
<exclude>
37+
<!--
38+
<group>slow</group>
39+
<group>shortTokenExpiry</group>
40+
-->
41+
<group>providerLiveTest</group>
42+
</exclude>
43+
</groups>
2644
<php>
2745
<!-- whether the test runs on CI - set to false to allow live API tests to run -->
2846
<const name="TEST_IS_CI" value="true"/>
2947
<!-- the config directory, where .env, cacert.pem and test oauth tokens reside, relative from project root -->
30-
<const name="TEST_CFGDIR" value="./config"/>
48+
<const name="TEST_CFGDIR" value="config"/>
3149
<!-- the filename of your .env file -->
3250
<const name="TEST_ENVFILE" value=".env_example"/>
3351
<!-- the http client factory for live api tests -->
34-
<!--
35-
<const name="TEST_CLIENT_FACTORY" value="chillerlan\OAuthTest\Helpers\ChillerlanHttpClientFactory"/>
36-
-->
37-
<const name="TEST_CLIENT_FACTORY" value="chillerlan\OAuthTest\Helpers\GuzzleHttpClientFactory"/>
52+
<const name="HTTP_CLIENT_FACTORY" value="chillerlan\PHPUnitHttp\GuzzleHttpClientFactory"/>
3853
<!-- PSR-17 factories to use in tests -->
3954
<const name="REQUEST_FACTORY" value="GuzzleHttp\Psr7\HttpFactory"/>
4055
<const name="RESPONSE_FACTORY" value="GuzzleHttp\Psr7\HttpFactory"/>

tests/Core/AccessTokenTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
use chillerlan\OAuth\Core\AccessToken;
1515
use PHPUnit\Framework\Attributes\{DataProvider, Group};
1616
use PHPUnit\Framework\TestCase;
17-
use function sleep, time;
17+
use function sleep;
18+
use function time;
1819

1920
/**
2021
* Tests the AccessToken class

tests/Core/DummyOAuth2BasicProvider.php

-26
This file was deleted.

tests/Core/DummyOAuth2TestBasic.php

-56
This file was deleted.

tests/Core/OAuth1Test.php

-25
This file was deleted.

tests/Core/OAuth2Test.php

-25
This file was deleted.

tests/Core/RequestTest.php

-89
This file was deleted.

tests/Core/RequestTestProvider.php

-33
This file was deleted.

tests/Helpers/ChillerlanHttpClientFactory.php

-31
This file was deleted.

0 commit comments

Comments
 (0)