Skip to content

Commit 4cc03fa

Browse files
committed
VCR Plugin: Remove it from require-dev.
Also skip the tests which rely on it when the plugin is not installed. The tests are still executed when check httplug 2.x clients.
1 parent 9a99489 commit 4cc03fa

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ matrix:
2828
- php: 7.1
2929
- php: 7.2
3030
- php: 7.3
31-
env: COVERAGE=true TEST_COMMAND="composer test-ci"
31+
env: COVERAGE=true TEST_COMMAND="composer test-ci" DEPENDENCIES="php-http/vcr-plugin:^1.0@dev"
3232

3333
# Test LTS versions
3434
- php: 7.3
@@ -42,11 +42,11 @@ matrix:
4242

4343
# Test with httplug 2.x clients
4444
- php: 7.2
45-
env: DEPENDENCIES="php-http/guzzle6-adapter:^2.0.1 php-http/curl-client:^2.0.0"
45+
env: DEPENDENCIES="php-http/guzzle6-adapter:^2.0.1 php-http/curl-client:^2.0.0 php-http/vcr-plugin:^1.0@dev"
4646

4747
# Latest commit to master
4848
- php: 7.3
49-
env: STABILITY="dev"
49+
env: STABILITY="dev" DEPENDENCIES="php-http/vcr-plugin:^1.0@dev"
5050

5151
allow_failures:
5252
# dev stability is allowed to fail.

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"php-http/guzzle6-adapter": "^1.1.1 || ^2.0.1",
5454
"php-http/mock-client": "^1.2",
5555
"php-http/promise": "^1.0",
56-
"php-http/vcr-plugin": "^1.0@dev",
5756
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
5857
"symfony/browser-kit": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
5958
"symfony/cache": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",

tests/Unit/DependencyInjection/HttplugExtensionTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ public function testBatchClientCanBePublic()
457457
*/
458458
public function testVcrPluginConfiguration(array $config, array $services, array $arguments = [])
459459
{
460+
if (!class_exists(\Http\Client\Plugin\Vcr\Recorder\InMemoryRecorder::class)) {
461+
$this->markTestSkipped('VCR plugin is not installed.');
462+
}
463+
460464
$prefix = 'httplug.client.acme.vcr';
461465
$this->load(['clients' => ['acme' => ['plugins' => [['vcr' => $config]]]]]);
462466
$this->assertContainerBuilderHasService('httplug.plugin.vcr.recorder.in_memory', InMemoryRecorder::class);
@@ -477,6 +481,10 @@ public function testVcrPluginConfiguration(array $config, array $services, array
477481
*/
478482
public function testIsNotLoadedUnlessNeeded()
479483
{
484+
if (!class_exists(\Http\Client\Plugin\Vcr\Recorder\InMemoryRecorder::class)) {
485+
$this->markTestSkipped('VCR plugin is not installed.');
486+
}
487+
480488
$this->load(['clients' => ['acme' => ['plugins' => []]]]);
481489
$this->assertContainerBuilderNotHasService('httplug.plugin.vcr.recorder.in_memory');
482490
}

0 commit comments

Comments
 (0)