I replaced assertObjectHasAttribute() with assertIsObject() & assertTrue(property_exists($json, 'thing we are looking for'))
I replaced assertObjectNotHasAttribute() with assertIsObject() & assertFalse(property_exists($json, 'thing we are looking for'))
Set the protected_claim_sets() function to static.
Migrated the PHPUnit XML configuration.
Before
PHPUnit 10.3.1 by Sebastian Bergmann and contributors.
Runtime: PHP 8.2.8
Configuration: laravel-openid-connect/phpunit.xml
D..............................E
Time: 00:00.171, Memory: 24.45 MB
Claim Extractor (OpenIDConnect\Tests\Feature\ClaimExtractor)
✔ Default claim sets exist with profile
✔ Default claim sets exist with email
✔ Default claim sets exist with address
✔ Default claim sets exist with phone
✔ Cannot override protected scope with profile
✔ Cannot override protected scope with email
✔ Cannot override protected scope with address
✔ Cannot override protected scope with phone
✔ Can get scope by name with profile
✔ Can get scope by name with email
✔ Can get scope by name with address
✔ Can get scope by name with phone
✔ Can set and extract custom claim set
✔ Can safely get uknown claim set
✔ Can safely extract uknown claim
✔ Can safely extract known claim set
✔ Can safely extract invalid claim set
Configuration (OpenIDConnect\Tests\Feature\Configuration)
✔ Can create configurations
✔ Can create configurations with key from text
✔ Configuration needs correct signer key path
Id Token (OpenIDConnect\Tests\Feature\IdToken)
✔ Can create id token responses
✔ Can create id token responses with openid claim set
✘ Receive id token with open id scope
┐
├ Error: Call to undefined method OpenIDConnect\Tests\Feature\IdTokenTest::assertObjectHasAttribute()
│
│ laravel-openid-connect/tests/Feature/Traits/WithDefaultAsserts.php:26
│ laravel-openid-connect/tests/Feature/IdTokenTest.php:57
┴
Identity Entity (OpenIDConnect\Tests\Unit\IdentityEntity)
✔ Identity entity has claims property
✔ Identity entity has get claims method
✔ Identity entity has set claims method
✔ Identity entity has identifier property
✔ Identity entity has get identifier method
✔ Identity entity has set identifier method
Scope Entity (OpenIDConnect\Tests\Unit\ScopeEntity)
✔ Scope has entity identifier property
✔ Scope entity has get identifier method
✔ Scope entity set identifier method
There was 1 PHPUnit test runner deprecation:
1) Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!
--
3 tests triggered 3 PHPUnit deprecations:
1) OpenIDConnect\Tests\Feature\ClaimExtractorTest::test_default_claim_sets_exist
Data Provider method OpenIDConnect\Tests\Feature\ClaimExtractorTest::protected_claim_sets() is not static
laravel-openid-connect/tests/Feature/ClaimExtractorTest.php:23
2) OpenIDConnect\Tests\Feature\ClaimExtractorTest::test_cannot_override_protected_scope
Data Provider method OpenIDConnect\Tests\Feature\ClaimExtractorTest::protected_claim_sets() is not static
laravel-openid-connect/tests/Feature/ClaimExtractorTest.php:32
3) OpenIDConnect\Tests\Feature\ClaimExtractorTest::test_can_get_scope_by_name
Data Provider method OpenIDConnect\Tests\Feature\ClaimExtractorTest::protected_claim_sets() is not static
laravel-openid-connect/tests/Feature/ClaimExtractorTest.php:42
ERRORS!
Tests: 32, Assertions: 43, Errors: 1, Deprecations: 4, Notices: 1.
After
PHPUnit 10.3.1 by Sebastian Bergmann and contributors.
Runtime: PHP 8.2.8
Configuration: laravel-openid-connect/phpunit.xml
...............................NNNNN 36 / 36 (100%)
Time: 00:00.793, Memory: 24.45 MB
Claim Extractor (OpenIDConnect\Tests\Feature\ClaimExtractor)
✔ Default claim sets exist with profile
✔ Default claim sets exist with email
✔ Default claim sets exist with address
✔ Default claim sets exist with phone
✔ Cannot override protected scope with profile
✔ Cannot override protected scope with email
✔ Cannot override protected scope with address
✔ Cannot override protected scope with phone
✔ Can get scope by name with profile
✔ Can get scope by name with email
✔ Can get scope by name with address
✔ Can get scope by name with phone
✔ Can set and extract custom claim set
✔ Can safely get uknown claim set
✔ Can safely extract uknown claim
✔ Can safely extract known claim set
✔ Can safely extract invalid claim set
Configuration (OpenIDConnect\Tests\Feature\Configuration)
✔ Can create configurations
✔ Can create configurations with key from text
✔ Configuration needs correct signer key path
Id Token (OpenIDConnect\Tests\Feature\IdToken)
✔ Can create id token responses
✔ Can create id token responses with openid claim set
✔ Receive id token with open id scope
Identity Entity (OpenIDConnect\Tests\Unit\IdentityEntity)
✔ Identity entity has claims property
✔ Identity entity has get claims method
✔ Identity entity has set claims method
✔ Identity entity has identifier property
✔ Identity entity has get identifier method
✔ Identity entity has set identifier method
Oauth (OpenIDConnect\Tests\Feature\Oauth)
✔ Default response has no id token
Scope Entity (OpenIDConnect\Tests\Unit\ScopeEntity)
✔ Scope has entity identifier property
✔ Scope entity has get identifier method
✔ Scope entity set identifier method
Tokens (OpenIDConnect\Tests\Feature\Tokens)
✔ Id token is valid
✔ Id token with email scope returns email claim
✔ Id token with custom scope returns custom claim
OK, but there were issues!
Tests: 36, Assertions: 86, Notices: 1.
assertObjectHasAttribute()
withassertIsObject()
&assertTrue(property_exists($json, 'thing we are looking for'))
assertObjectNotHasAttribute()
withassertIsObject()
&assertFalse(property_exists($json, 'thing we are looking for'))
protected_claim_sets()
function tostatic
.Before
After