Skip to content

Commit 3ccd3f0

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 3ccd3f0

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ 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

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)