Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Github/Api/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function all($username, $repository, array $params = [])
*/
public function show($username, $repository, $name)
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.$name);
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($name));
}

/**
Expand All @@ -53,7 +53,7 @@ public function show($username, $repository, $name)
*/
public function createOrUpdate($username, $repository, $name, array $params = [])
{
return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments', $params);
return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($name), $params);
}

/**
Expand All @@ -65,6 +65,6 @@ public function createOrUpdate($username, $repository, $name, array $params = []
*/
public function remove(string $username, string $repository, string $name)
{
return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.$name);
return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($name));
}
}
2 changes: 1 addition & 1 deletion test/Github/Tests/Api/EnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function shouldCreateOrUpdateEnvironment()

$api->expects($this->once())
->method('put')
->with('/repos/KnpLabs/php-github-api/environments');
->with('/repos/KnpLabs/php-github-api/environments/production');

$api->createOrUpdate('KnpLabs', 'php-github-api', 'production');
}
Expand Down