public function testChaining() { $mock = new MockHandler([new Response(200, [])]); $tester = new WebhookTester(); $client = $tester->setClient(new Client(['handler' => HandlerStack::create($mock)])); $response = $tester->setEndpoint('http://localhost/stripe/webhooks')->setVersion('2014-09-08')->triggerEvent('charge.succeeded'); $this->assertEquals(200, $response->getStatusCode()); }
public function testChaining() { $mock = new Mock([new Response(200, []), "HTTP/1.1 202 OK\r\nContent-Length: 0\r\n\r\n"]); $tester = new WebhookTester(); $client = $tester->getClient()->getEmitter()->attach($mock); $response = $tester->setEndpoint('http://localhost/stripe/webhooks')->setVersion('2014-09-08')->triggerEvent('charge.succeeded'); $this->assertEquals(200, $response->getStatusCode()); }