Skip to content

Commit d0b79d0

Browse files
authored
Merge pull request #13 from ByteInternet/use-new-brancher-app-endpoint
use-new-brancher-app-endpoint
2 parents 43404db + 65e6778 commit d0b79d0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Service/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class App extends AbstractService
99
public const V2_APP_LIST_URL = "/v2/app/";
1010
public const V2_APP_DETAIL_URL = "/v2/app/%s/";
1111
public const V2_APP_CANCEL_URL = "/v2/app/%s/cancel/";
12-
public const V2_APP_BRANCHER_URL = "/v2/app/%s/brancher/";
12+
public const V2_BRANCHER_APP_URL = "/v2/brancher/app/%s/";
1313
public const V1_APP_FLOWS_URL = "/logbook/v1/logbooks/%s/flows/";
1414

1515
/**

src/Service/BrancherApp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class BrancherApp extends AbstractService
2020
*/
2121
public function create(string $app, ?array $data = null): string
2222
{
23-
$url = sprintf(App::V2_APP_BRANCHER_URL, $app);
23+
$url = sprintf(App::V2_BRANCHER_APP_URL, $app);
2424

2525
$response = $this->client->api->post($url, [], $data ? json_encode($data) : null);
2626

tests/unit/Service/BrancherAppTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testCreateBrancherApp()
2525

2626
$request = $this->responses->getLastRequest();
2727
$this->assertEquals('POST', $request->getMethod());
28-
$this->assertEquals('/v2/app/johndoe/brancher/', $request->getUri());
28+
$this->assertEquals('/v2/brancher/app/johndoe/', $request->getUri());
2929
$this->assertEquals('johndoe-eph123456', $brancherAppName);
3030
}
3131

@@ -46,7 +46,7 @@ public function testCreateBrancherAppWithData()
4646

4747
$request = $this->responses->getLastRequest();
4848
$this->assertEquals('POST', $request->getMethod());
49-
$this->assertEquals('/v2/app/johndoe/brancher/', $request->getUri());
49+
$this->assertEquals('/v2/brancher/app/johndoe/', $request->getUri());
5050
$this->assertEquals('johndoe-eph123456', $brancherAppName);
5151
$this->assertJson((string)$request->getBody());
5252
$this->assertEquals(

0 commit comments

Comments
 (0)