Skip to content

Commit b8451d3

Browse files
committed
add test for throttle plugin
1 parent a95d54e commit b8451d3

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@ jobs:
2222
include:
2323
# Minimum supported Symfony version and lowest PHP version
2424
- dependencies: "php-http/guzzle7-adapter php-http/discovery:^1.12"
25-
php-version: "7.3"
25+
php-version: "7.4"
2626
dependency-versions: "lowest"
2727
symfony-deprecations-helper: "weak"
2828
stability: "stable"
2929

3030
# Test the latest stable release
3131
- dependencies: "php-http/guzzle7-adapter php-http/vcr-plugin:^1.0@dev"
32-
php-version: "7.3"
33-
symfony-deprecations-helper: "weak"
34-
- dependencies: "php-http/guzzle6-adapter"
3532
php-version: "7.4"
3633
symfony-deprecations-helper: "weak"
3734
- dependencies: "php-http/guzzle7-adapter"
@@ -49,7 +46,7 @@ jobs:
4946

5047
# Test with httplug 2.x clients
5148
- dependencies: "php-http/guzzle7-adapter php-http/curl-client:^2.0.0 php-http/vcr-plugin:^1.0@dev php-http/socket-client:^2.0"
52-
php-version: "7.3"
49+
php-version: "7.4"
5350
symfony-deprecations-helper: "weak"
5451

5552
# Latest commit to master
@@ -65,7 +62,7 @@ jobs:
6562
# Test maintained versions of Symfony
6663
- dependencies: "php-http/guzzle7-adapter symfony/http-client:^5.4"
6764
symfony-require: "5.4.*"
68-
php-version: "7.3"
65+
php-version: "7.4"
6966
symfony-deprecations-helper: "weak"
7067
- dependencies: "php-http/guzzle7-adapter symfony/http-client:^6.0"
7168
symfony-require: "6.3.*"

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"nyholm/nsa": "^1.1",
5757
"nyholm/psr7": "^1.2.1",
5858
"php-http/cache-plugin": "^1.7",
59+
"php-http/throttle-plugin": "^1.1",
5960
"php-http/mock-client": "^1.2",
6061
"php-http/promise": "^1.0",
6162
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0",

tests/Unit/DependencyInjection/HttplugExtensionTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ public function testClientPlugins(): void
131131
'headers' => ['X-FOO'],
132132
],
133133
],
134+
[
135+
'query_defaults' => [
136+
'parameters' => ['locale' => 'en'],
137+
],
138+
],
134139
[
135140
'request_seekable_body' => [
136141
'use_file_buffer' => true,
@@ -140,9 +145,7 @@ public function testClientPlugins(): void
140145
'response_seekable_body' => true,
141146
],
142147
[
143-
'query_defaults' => [
144-
'parameters' => ['locale' => 'en'],
145-
],
148+
'throttle' => true,
146149
],
147150
[
148151
'authentication' => [
@@ -179,9 +182,10 @@ public function testClientPlugins(): void
179182
'httplug.client.acme.plugin.header_defaults',
180183
'httplug.client.acme.plugin.header_set',
181184
'httplug.client.acme.plugin.header_remove',
185+
'httplug.client.acme.plugin.query_defaults',
182186
'httplug.client.acme.plugin.request_seekable_body',
183187
'httplug.client.acme.plugin.response_seekable_body',
184-
'httplug.client.acme.plugin.query_defaults',
188+
'httplug.client.acme.plugin.throttle',
185189
'httplug.client.acme.authentication.my_basic',
186190
'httplug.client.acme.plugin.cache',
187191
'httplug.client.acme.plugin.error',

0 commit comments

Comments
 (0)