1818use PHPUnit \Framework \TestCase ;
1919use SimpleSAML \Configuration ;
2020use SimpleSAML \Module \oidc \Entities \ScopeEntity ;
21+ use SimpleSAML \Module \oidc \Factories \Entities \ScopeEntityFactory ;
2122use SimpleSAML \Module \oidc \ModuleConfig ;
2223use SimpleSAML \Module \oidc \Repositories \ScopeRepository ;
2324use SimpleSAML \Module \oidc \Services \DatabaseMigration ;
@@ -48,11 +49,11 @@ public static function setUpBeforeClass(): void
4849 */
4950 public function testGetScopeEntityByIdentifier (): void
5051 {
51- $ scopeRepository = new ScopeRepository (new ModuleConfig ());
52+ $ scopeRepository = new ScopeRepository (new ModuleConfig (), new ScopeEntityFactory () );
5253
5354 $ scope = $ scopeRepository ->getScopeEntityByIdentifier ('openid ' );
5455
55- $ expected = ScopeEntity:: fromData (
56+ $ expected = new ScopeEntity (
5657 'openid ' ,
5758 'openid ' ,
5859 );
@@ -65,7 +66,7 @@ public function testGetScopeEntityByIdentifier(): void
6566 */
6667 public function testGetUnknownScope (): void
6768 {
68- $ scopeRepository = new ScopeRepository (new ModuleConfig ());
69+ $ scopeRepository = new ScopeRepository (new ModuleConfig (), new ScopeEntityFactory () );
6970
7071 $ this ->assertNull ($ scopeRepository ->getScopeEntityByIdentifier ('none ' ));
7172 }
@@ -75,17 +76,17 @@ public function testGetUnknownScope(): void
7576 */
7677 public function testFinalizeScopes (): void
7778 {
78- $ scopeRepository = new ScopeRepository (new ModuleConfig ());
79+ $ scopeRepository = new ScopeRepository (new ModuleConfig (), new ScopeEntityFactory () );
7980 $ scopes = [
80- ScopeEntity:: fromData ('openid ' ),
81- ScopeEntity:: fromData ('basic ' ),
81+ new ScopeEntity ('openid ' ),
82+ new ScopeEntity ('basic ' ),
8283 ];
8384 $ client = ClientRepositoryTest::getClient ('clientid ' );
8485
8586 $ finalizedScopes = $ scopeRepository ->finalizeScopes ($ scopes , 'any ' , $ client );
8687
8788 $ expectedScopes = [
88- ScopeEntity:: fromData ('openid ' ),
89+ new ScopeEntity ('openid ' ),
8990 ];
9091 $ this ->assertEquals ($ expectedScopes , $ finalizedScopes );
9192 }
0 commit comments