Skip to content

Commit f415418

Browse files
authored
Enable Mock strategy for HttpRequests
1 parent 2968d91 commit f415418

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/TestCase.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Omnipay\Tests;
44

5+
use Http\Discovery\HttpClientDiscovery;
6+
use Http\Discovery\Strategy\MockClientStrategy;
57
use Mockery as m;
68
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
79
use Omnipay\Common\Http\Client;
@@ -34,6 +36,13 @@ abstract class TestCase extends PHPUnitTestCase
3436
/** @var HttpRequest */
3537
private $httpRequest;
3638

39+
protected function setUp(): void
40+
{
41+
parent::setUp();
42+
43+
HttpClientDiscovery::prependStrategy(MockClientStrategy::class);
44+
}
45+
3746
/**
3847
* Converts a string to camel case
3948
*

0 commit comments

Comments
 (0)