public function testOverrideSetCorrectlyANewService()
 {
     // Arrange
     $id = 'service_foo';
     $service = new \stdClass();
     // Act.
     Container::set($id, $service);
     //Assert.
     $this->assertEquals($service, Container::get($id));
 }
Beispiel #2
0
 /**
  * @param array $responses
  */
 protected function setClientWithMockedResponse(array $responses)
 {
     $mock = new MockHandler($responses);
     $handler = HandlerStack::create($mock);
     $this->mockClient = new GuzzleClient(['handler' => $handler]);
     Container::set('guzzle_client', $this->mockClient);
     $this->client = new Client(['apiKey' => 'foo', 'clientId' => 'bar', 'clientSecret' => 'foo-bar', 'token' => ['provider' => FileSystemProvider::class, 'args' => [vfsStream::url('test-wadify-client') . '/token.json']]]);
 }