public function testTriggerEvent() { $mock = new MockHandler([new Response(200, [])]); $tester = new WebhookTester(); $client = $tester->setClient(new Client(['handler' => HandlerStack::create($mock)])); $tester->setVersion('2014-09-08'); $tester->setEndpoint('http://localhost/stripe/webhooks'); $response = $tester->triggerEvent('charge.succeeded'); $this->assertEquals(200, $response->getStatusCode()); }
public function testTriggerEvent() { $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); $tester->setVersion('2014-09-08'); $tester->setEndpoint('http://localhost/stripe/webhooks'); $response = $tester->triggerEvent('charge.succeeded'); $this->assertEquals(200, $response->getStatusCode()); }