Skip to content

Commit 2443e7f

Browse files
Wouter0100m1guelpf
authored andcommitted
Updated tests to return a promise
This will fix the tests for the new redirect check.
1 parent 7026e73 commit 2443e7f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/Gitlab/Tests/HttpClient/Plugin/ApiVersionTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function testPrefixRequestPath()
3636
$request = new Request('GET', 'projects');
3737
$expected = new Request('GET', '/api/v4/projects');
3838
$plugin = new ApiVersion();
39+
$promise = new HttpFulfilledPromise(new Response());
3940

4041
$callback = $this->getMockBuilder(\stdClass::class)
4142
->setMethods(['next'])
@@ -44,6 +45,7 @@ public function testPrefixRequestPath()
4445
$callback->expects($this->once())
4546
->method('next')
4647
->with($expected)
48+
->willReturn($promise)
4749
;
4850

4951
$plugin->handleRequest($request, [$callback, 'next'], function () {
@@ -54,6 +56,7 @@ public function testNoPrefixingRequired()
5456
{
5557
$request = new Request('GET', '/api/v4/projects');
5658
$plugin = new ApiVersion();
59+
$promise = new HttpFulfilledPromise(new Response());
5760

5861
$callback = $this->getMockBuilder(\stdClass::class)
5962
->setMethods(['next'])
@@ -62,6 +65,7 @@ public function testNoPrefixingRequired()
6265
$callback->expects($this->once())
6366
->method('next')
6467
->with($request)
68+
->willReturn($promise)
6569
;
6670

6771
$plugin->handleRequest($request, [$callback, 'next'], function () {

0 commit comments

Comments
 (0)