Skip to content

Commit 0cd71a9

Browse files
committed
Made the functional tests use the auth key and version parameters used on each specific installation
1 parent dcd70c0 commit 0cd71a9

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerFunctionalTest.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,22 @@ public function testStatusAction() {
2424
public function testHandleRequestGet() {
2525
$client = static::createClient();
2626

27-
/*
28-
* Using the same auth key and version like the ones in the dist parameter file
29-
*/
30-
$client->request('GET', '/authKey/v1');
27+
$authorizationKey = $client->getContainer()->getParameter('auth_key');
28+
$apiVersion = $client->getContainer()->getParameter('version');
29+
$client->request('GET', "/{$authorizationKey}/{$apiVersion}/");
3130

3231
$this->assertEquals($client->getResponse()->getStatusCode(), 405);
3332
}
3433

3534
public function testHandleRequestCompile() {
3635
$client = static::createClient();
3736

37+
$authorizationKey = $client->getContainer()->getParameter('auth_key');
38+
$apiVersion = $client->getContainer()->getParameter('version');
3839
$client
3940
->request(
4041
'POST',
41-
'authenticationekey/version',
42+
"/{$authorizationKey}/{$apiVersion}/",
4243
$parameters = array(),
4344
$files = array(),
4445
$server = array(),
@@ -54,10 +55,12 @@ public function testHandleRequestCompile() {
5455
public function testHandleRequestLibraryFetching() {
5556
$client = static::createClient();
5657

58+
$authorizationKey = $client->getContainer()->getParameter('auth_key');
59+
$apiVersion = $client->getContainer()->getParameter('version');
5760
$client
5861
->request(
5962
'POST',
60-
'authenticationekey/version',
63+
"/{$authorizationKey}/{$apiVersion}/",
6164
$parameters = array(),
6265
$files = array(),
6366
$server = array(),
@@ -74,10 +77,12 @@ public function testHandleRequestLibraryFetching() {
7477
public function testHandleRequestLibraryKeywords() {
7578
$client = static::createClient();
7679

80+
$authorizationKey = $client->getContainer()->getParameter('auth_key');
81+
$apiVersion = $client->getContainer()->getParameter('version');
7782
$client
7883
->request(
7984
'POST',
80-
'authenticationekey/version',
85+
"/{$authorizationKey}/{$apiVersion}/",
8186
$parameters = array(),
8287
$files = array(),
8388
$server = array(),

0 commit comments

Comments
 (0)