Source of file TestGatewayFactory.php
Size: 0,911 Bytes - Last Modified: 2021-12-24T06:34:53+00:00
/var/www/docs.ssmods.com/process/src/tests/Service/TestGatewayFactory.php
123456789101112131415161718192021222324252627282930313233 | <?php namespace SilverStripe\Omnipay\Tests\Service; use Omnipay\Common\GatewayFactory; use Omnipay\Common\Http\ClientInterface; use SilverStripe\Dev\TestOnly; use Symfony\Component\HttpFoundation\Request as HttpRequest; /** * Helper class to inject our desired HTTP client and requests into the newly created gateway instances. * @package SilverStripe\Omnipay\Tests\Service */ class TestGatewayFactory extends GatewayFactory implements TestOnly { /** * HTTP client to use for gateways (for unit-tests) * @var ClientInterface */ public static $httpClient; /** * HTTP request to use for gateways (for unit-tests) * @var HttpRequest */ public static $httpRequest; public function create($class, ClientInterface $httpClient = null, HttpRequest $httpRequest = null) { return parent::create($class, self::$httpClient, self::$httpRequest); } } |