Skip to content

Commit

Permalink
Feature: Migrate to PHPUnit ^6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed May 24, 2018
1 parent 04a444b commit 97738af
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -31,7 +31,7 @@
},
"require-dev": {
"squizlabs/php_codesniffer": "~3.0.1",
"phpunit/phpunit": "~4.8.34"
"phpunit/phpunit": "^6.5.8"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 1 addition & 2 deletions tests/Test/OAuth1/Provider/AtlassianTest.php
Expand Up @@ -8,12 +8,11 @@

use SocialConnect\Common\Http\Client\ClientInterface;
use SocialConnect\OAuth1\Provider\Atlassian;
use SocialConnect\OAuth1\Signature\AbstractSignatureMethod;
use SocialConnect\OAuth1\Signature\MethodRSASHA1;
use SocialConnect\Provider\Consumer;
use SocialConnect\Provider\Session\SessionInterface;

class AtlassianTest extends \PHPUnit_Framework_TestCase
class AtlassianTest extends \PHPUnit\Framework\TestCase
{
/** @expectedException \InvalidArgumentException */
public function testConstructorThrowsExceptionOnMissingBaseUri()
Expand Down
6 changes: 4 additions & 2 deletions tests/Test/OAuth2/Provider/VimeoTest.php
Expand Up @@ -18,11 +18,13 @@ protected function getProviderClassName()

public function testGetIdentityInternalServerError()
{
// Ignore this test for Vimeo
// to skip warning
parent::assertTrue(true);
}

public function testGetIdentityNotValidJSON()
{
// Ignore this test for Vimeo
// to skip warning
parent::assertTrue(true);
}
}
19 changes: 14 additions & 5 deletions tests/Test/OpenIDConnect/JWTTest.php
Expand Up @@ -83,6 +83,9 @@ public function testValidateClaimsSuccess()
$token,
'validateClaims'
);

// to skip warning
parent::assertTrue(true);
}

public function testValidateClaimsNbfFail()
Expand All @@ -96,7 +99,7 @@ public function testValidateClaimsNbfFail()
$this->getTestHeader()
);

parent::setExpectedException(
parent::expectException(
\SocialConnect\OpenIDConnect\Exception\InvalidJWT::class,
sprintf(
'nbf (Not Fefore) claim is not valid %s',
Expand Down Expand Up @@ -129,6 +132,9 @@ public function testValidateClaimsNbfScrew()
);

JWT::$screw = 0;

// to skip warning
parent::assertTrue(true);
}

public function testValidateClaimsExpFail()
Expand All @@ -142,7 +148,7 @@ public function testValidateClaimsExpFail()
$this->getTestHeader()
);

parent::setExpectedException(
parent::expectException(
\SocialConnect\OpenIDConnect\Exception\InvalidJWT::class,
sprintf(
'exp (Expiration Time) claim is not valid %s',
Expand All @@ -167,6 +173,9 @@ public function testValidateHeaderSuccess()
$token,
'validateHeader'
);

// to skip warning
parent::assertTrue(true);
}

public function testValidateHeaderNoAlg()
Expand All @@ -178,7 +187,7 @@ public function testValidateHeaderNoAlg()
]
);

parent::setExpectedException(
parent::expectException(
InvalidJWT::class,
'No alg inside header'
);
Expand All @@ -198,7 +207,7 @@ public function testValidateHeaderNoKid()
]
);

parent::setExpectedException(
parent::expectException(
InvalidJWT::class,
'No kid inside header'
);
Expand All @@ -211,7 +220,7 @@ public function testValidateHeaderNoKid()

public function testDecodeWrongNumberOfSegments()
{
parent::setExpectedException(
parent::expectException(
InvalidJWT::class,
'Wrong number of segments'
);
Expand Down
3 changes: 1 addition & 2 deletions tests/Test/TestCase.php
Expand Up @@ -6,10 +6,9 @@

namespace Test;

use PHPUnit_Framework_TestCase;
use SocialConnect\Auth\Service;

class TestCase extends PHPUnit_Framework_TestCase
class TestCase extends \PHPUnit\Framework\TestCase
{
protected function getService()
{
Expand Down

0 comments on commit 97738af

Please sign in to comment.