diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index 14d7957fe5..28082851c0 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -211,7 +211,7 @@ class Configuration */ public function setAccessToken($accessToken) { - $this->$accessToken = $accessToken; + $this->accessToken = $accessToken; return $this; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php index 1fdac785bf..033f2da7a2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php @@ -211,7 +211,7 @@ class Configuration */ public function setAccessToken($accessToken) { - $this->$accessToken = $accessToken; + $this->accessToken = $accessToken; return $this; } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php index fe818069da..58d5cd661f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php @@ -82,6 +82,10 @@ class PetApiTest extends \PHPUnit_Framework_TestCase $this->assertNotEquals($apiClient3, $apiClient4); // customied pet api not using the old pet api's api client $this->assertNotEquals($pet_api2->getApiClient(), $pet_api3->getApiClient()); + + // test access token + $api_client->getConfig()->setAccessToken("testing_only"); + $this->assertSame('testing_only', $api_client->getConfig()->getAccessToken()); } // test getPetById with a Pet object (id 10005)