public function addMockResults(array $results, callable $onFulfilled = null, callable $onRejected = null) { $mock = new MockHandler($results, $onFulfilled, $onRejected); $handler = HandlerStack::create($mock); $handler->push(Middleware::history($this->history)); $container = WpsContainer::getInstance(); $container->container->add('WpsClient', function () use($handler) { return WpsClient::factory(['base_uri' => '/', 'defaults' => ['headers' => ['Content-Type' => 'application/json']], 'handler' => $handler], true); }); }
public static function make($alias, array $args = [[]]) { return WpsContainer::getInstance()->container->get($alias, $args); }