Skip to content

Commit

Permalink
Updated to PHPUnit 4.8 (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel authored and bshaffer committed Dec 6, 2017
1 parent 409d7f8 commit 8baf334
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 37 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"require-dev": {
"guzzlehttp/promises": "0.1.1|^1.3",
"friendsofphp/php-cs-fixer": "^1.11",
"phpunit/phpunit": "^4.8",
"phpunit/phpunit": "^4.8.36",
"sebastian/comparator": ">=1.2.3"
},
"autoload": {
Expand Down
5 changes: 3 additions & 2 deletions tests/ApplicationDefaultCredentialsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
use Google\Auth\Credentials\GCECredentials;
use Google\Auth\Credentials\ServiceAccountCredentials;
use GuzzleHttp\Psr7;
use PHPUnit\Framework\TestCase;

class ADCGetTest extends \PHPUnit_Framework_TestCase
class ADCGetTest extends TestCase
{
private $originalHome;

Expand Down Expand Up @@ -101,7 +102,7 @@ public function testSuccedsIfNoDefaultFilesButIsOnGCE()
}
}

class ADCGetMiddlewareTest extends \PHPUnit_Framework_TestCase
class ADCGetMiddlewareTest extends TestCase
{
private $originalHome;

Expand Down
3 changes: 2 additions & 1 deletion tests/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Google\Auth\tests;

use GuzzleHttp\ClientInterface;
use PHPUnit\Framework\TestCase;

abstract class BaseTest extends \PHPUnit_Framework_TestCase
abstract class BaseTest extends TestCase
{
public function onlyGuzzle6()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Cache/ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
namespace Google\Auth\Tests;

use Google\Auth\Cache\Item;
use PHPUnit\Framework\TestCase;

class ItemTest extends \PHPUnit_Framework_TestCase
class ItemTest extends TestCase
{
public function getItem($key)
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Cache/MemoryCacheItemPoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
namespace Google\Auth\Tests;

use Google\Auth\Cache\MemoryCacheItemPool;
use PHPUnit\Framework\TestCase;
use Psr\Cache\InvalidArgumentException;

class MemoryCacheItemPoolTest extends \PHPUnit_Framework_TestCase
class MemoryCacheItemPoolTest extends TestCase
{
private $pool;

Expand Down
3 changes: 2 additions & 1 deletion tests/CacheTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
namespace Google\Auth\Tests;

use Google\Auth\CacheTrait;
use PHPUnit\Framework\TestCase;

class CacheTraitTest extends \PHPUnit_Framework_TestCase
class CacheTraitTest extends TestCase
{
private $mockFetcher;
private $mockCacheItem;
Expand Down
7 changes: 4 additions & 3 deletions tests/Credentials/AppIndentityCredentialsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
use google\appengine\api\app_identity\AppIdentityService;
// included from tests\mocks\AppIdentityService.php
use Google\Auth\Credentials\AppIdentityCredentials;
use PHPUnit\Framework\TestCase;

class AppIdentityCredentialsOnAppEngineTest extends \PHPUnit_Framework_TestCase
class AppIdentityCredentialsOnAppEngineTest extends TestCase
{
public function testIsFalseByDefault()
{
Expand All @@ -41,7 +42,7 @@ public function testIsTrueWhenAppEngineRuntimeIsPhp()
}
}

class AppIdentityCredentialsGetCacheKeyTest extends \PHPUnit_Framework_TestCase
class AppIdentityCredentialsGetCacheKeyTest extends TestCase
{
public function testShouldBeEmpty()
{
Expand All @@ -50,7 +51,7 @@ public function testShouldBeEmpty()
}
}

class AppIdentityCredentialsFetchAuthTokenTest extends \PHPUnit_Framework_TestCase
class AppIdentityCredentialsFetchAuthTokenTest extends TestCase
{
public function testShouldBeEmptyIfNotOnAppEngine()
{
Expand Down
9 changes: 5 additions & 4 deletions tests/Credentials/GCECredentialsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
use Google\Auth\Credentials\GCECredentials;
use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\TestCase;

class GCECredentialsOnGCETest extends \PHPUnit_Framework_TestCase
class GCECredentialsOnGCETest extends TestCase
{
public function testIsFalseOnClientErrorStatus()
{
Expand Down Expand Up @@ -56,7 +57,7 @@ public function testIsOkIfGoogleIsTheFlavor()
}
}

class GCECredentialsOnAppEngineFlexibleTest extends \PHPUnit_Framework_TestCase
class GCECredentialsOnAppEngineFlexibleTest extends TestCase
{
public function testIsFalseByDefault()
{
Expand All @@ -70,7 +71,7 @@ public function testIsTrueWhenGaeVmIsTrue()
}
}

class GCECredentialsGetCacheKeyTest extends \PHPUnit_Framework_TestCase
class GCECredentialsGetCacheKeyTest extends TestCase
{
public function testShouldNotBeEmpty()
{
Expand All @@ -79,7 +80,7 @@ public function testShouldNotBeEmpty()
}
}

class GCECredentialsFetchAuthTokenTest extends \PHPUnit_Framework_TestCase
class GCECredentialsFetchAuthTokenTest extends TestCase
{
public function testShouldBeEmptyIfNotOnGCE()
{
Expand Down
5 changes: 3 additions & 2 deletions tests/Credentials/IAMCredentialsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
namespace Google\Auth\Tests;

use Google\Auth\Credentials\IAMCredentials;
use PHPUnit\Framework\TestCase;

class IAMConstructorTest extends \PHPUnit_Framework_TestCase
class IAMConstructorTest extends TestCase
{
/**
* @expectedException InvalidArgumentException
Expand Down Expand Up @@ -53,7 +54,7 @@ public function testInitializeSuccess()
}
}

class IAMUpdateMetadataCallbackTest extends \PHPUnit_Framework_TestCase
class IAMUpdateMetadataCallbackTest extends TestCase
{
public function testUpdateMetadataFunc()
{
Expand Down
15 changes: 8 additions & 7 deletions tests/Credentials/ServiceAccountCredentialsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Google\Auth\CredentialsLoader;
use Google\Auth\OAuth2;
use GuzzleHttp\Psr7;
use PHPUnit\Framework\TestCase;

// Creates a standard JSON auth object for testing.
function createTestJson()
Expand All @@ -36,7 +37,7 @@ function createTestJson()
];
}

class SACGetCacheKeyTest extends \PHPUnit_Framework_TestCase
class SACGetCacheKeyTest extends TestCase
{
public function testShouldBeTheSameAsOAuth2WithTheSameScope()
{
Expand Down Expand Up @@ -87,7 +88,7 @@ public function testShouldBeTheSameAsOAuth2WithTheSameScopeWithSubAddedLater()
}
}

class SACConstructorTest extends \PHPUnit_Framework_TestCase
class SACConstructorTest extends TestCase
{
/**
* @expectedException InvalidArgumentException
Expand Down Expand Up @@ -148,7 +149,7 @@ public function testInitalizeFromAFile()
}
}

class SACFromEnvTest extends \PHPUnit_Framework_TestCase
class SACFromEnvTest extends TestCase
{
protected function tearDown()
{
Expand Down Expand Up @@ -178,7 +179,7 @@ public function testSucceedIfFileExists()
}
}

class SACFromWellKnownFileTest extends \PHPUnit_Framework_TestCase
class SACFromWellKnownFileTest extends TestCase
{
private $originalHome;

Expand Down Expand Up @@ -211,7 +212,7 @@ public function testSucceedIfFileIsPresent()
}
}

class SACFetchAuthTokenTest extends \PHPUnit_Framework_TestCase
class SACFetchAuthTokenTest extends TestCase
{
private $privateKey;

Expand Down Expand Up @@ -307,7 +308,7 @@ public function testUpdateMetadataFunc()
}
}

class SACJwtAccessTest extends \PHPUnit_Framework_TestCase
class SACJwtAccessTest extends TestCase
{
private $privateKey;

Expand Down Expand Up @@ -433,7 +434,7 @@ public function testUpdateMetadataFunc()
}
}

class SACJwtAccessComboTest extends \PHPUnit_Framework_TestCase
class SACJwtAccessComboTest extends TestCase
{
private $privateKey;

Expand Down
11 changes: 6 additions & 5 deletions tests/Credentials/UserRefreshCredentialsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Google\Auth\Credentials\UserRefreshCredentials;
use Google\Auth\OAuth2;
use GuzzleHttp\Psr7;
use PHPUnit\Framework\TestCase;

// Creates a standard JSON auth object for testing.
function createURCTestJson()
Expand All @@ -33,7 +34,7 @@ function createURCTestJson()
];
}

class URCGetCacheKeyTest extends \PHPUnit_Framework_TestCase
class URCGetCacheKeyTest extends TestCase
{
public function testShouldBeTheSameAsOAuth2WithTheSameScope()
{
Expand All @@ -50,7 +51,7 @@ public function testShouldBeTheSameAsOAuth2WithTheSameScope()
}
}

class URCConstructorTest extends \PHPUnit_Framework_TestCase
class URCConstructorTest extends TestCase
{
/**
* @expectedException InvalidArgumentException
Expand Down Expand Up @@ -111,7 +112,7 @@ public function testInitalizeFromAFile()
}
}

class URCFromEnvTest extends \PHPUnit_Framework_TestCase
class URCFromEnvTest extends TestCase
{
protected function tearDown()
{
Expand Down Expand Up @@ -141,7 +142,7 @@ public function testSucceedIfFileExists()
}
}

class URCFromWellKnownFileTest extends \PHPUnit_Framework_TestCase
class URCFromWellKnownFileTest extends TestCase
{
private $originalHome;

Expand Down Expand Up @@ -174,7 +175,7 @@ public function testSucceedIfFileIsPresent()
}
}

class URCFetchAuthTokenTest extends \PHPUnit_Framework_TestCase
class URCFetchAuthTokenTest extends TestCase
{
/**
* @expectedException GuzzleHttp\Exception\ClientException
Expand Down
19 changes: 10 additions & 9 deletions tests/OAuth2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
use Google\Auth\OAuth2;
use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\TestCase;

class OAuth2AuthorizationUriTest extends \PHPUnit_Framework_TestCase
class OAuth2AuthorizationUriTest extends TestCase
{
private $minimal = [
'authorizationUri' => 'https://accounts.test.org/insecure/url',
Expand Down Expand Up @@ -170,7 +171,7 @@ public function testRedirectUriPostmessageIsAllowed()
}
}

class OAuth2GrantTypeTest extends \PHPUnit_Framework_TestCase
class OAuth2GrantTypeTest extends TestCase
{
private $minimal = [
'authorizationUri' => 'https://accounts.test.org/insecure/url',
Expand Down Expand Up @@ -232,7 +233,7 @@ public function testSetsUrlAsGrantType()
}
}

class OAuth2GetCacheKeyTest extends \PHPUnit_Framework_TestCase
class OAuth2GetCacheKeyTest extends TestCase
{
private $minimal = [
'clientID' => 'aClientID',
Expand All @@ -259,7 +260,7 @@ public function testIsAllScopesWhenScopeIsArray()
}
}

class OAuth2TimingTest extends \PHPUnit_Framework_TestCase
class OAuth2TimingTest extends TestCase
{
private $minimal = [
'authorizationUri' => 'https://accounts.test.org/insecure/url',
Expand Down Expand Up @@ -319,7 +320,7 @@ public function testIsNotExpiredIfExpiresAtIsOld()
}
}

class OAuth2GeneralTest extends \PHPUnit_Framework_TestCase
class OAuth2GeneralTest extends TestCase
{
private $minimal = [
'authorizationUri' => 'https://accounts.test.org/insecure/url',
Expand Down Expand Up @@ -363,7 +364,7 @@ public function testAllowsUrnRedirectUri()
}
}

class OAuth2JwtTest extends \PHPUnit_Framework_TestCase
class OAuth2JwtTest extends TestCase
{
private $signingMinimal = [
'signingKey' => 'example_key',
Expand Down Expand Up @@ -481,7 +482,7 @@ private function jwtDecode()
}
}

class OAuth2GenerateAccessTokenRequestTest extends \PHPUnit_Framework_TestCase
class OAuth2GenerateAccessTokenRequestTest extends TestCase
{
private $tokenRequestMinimal = [
'tokenCredentialUri' => 'https://tokens_r_us/test',
Expand Down Expand Up @@ -629,7 +630,7 @@ public function testGeneratesExtendedRequests()
}
}

class OAuth2FetchAuthTokenTest extends \PHPUnit_Framework_TestCase
class OAuth2FetchAuthTokenTest extends TestCase
{
private $fetchAuthTokenMinimal = [
'tokenCredentialUri' => 'https://tokens_r_us/test',
Expand Down Expand Up @@ -774,7 +775,7 @@ public function testUpdatesTokenFieldsOnFetchMissingRefreshToken()
}
}

class OAuth2VerifyIdTokenTest extends \PHPUnit_Framework_TestCase
class OAuth2VerifyIdTokenTest extends TestCase
{
private $publicKey;
private $privateKey;
Expand Down

0 comments on commit 8baf334

Please sign in to comment.