@@ -40,6 +40,16 @@ public function testOutputFromString(): void
4040 $ this ->assertEquals ('123 ' , $ role ->getIdentifier ());
4141 $ this ->assertEquals ('456 ' , $ role ->getDimension ());
4242
43+ $ role = Role::parse ('team:123/project-456-owner ' );
44+ $ this ->assertEquals ('team ' , $ role ->getRole ());
45+ $ this ->assertEquals ('123 ' , $ role ->getIdentifier ());
46+ $ this ->assertEquals ('project-456-owner ' , $ role ->getDimension ());
47+
48+ $ role = Role::parse ('team:123/project-456 ' );
49+ $ this ->assertEquals ('team ' , $ role ->getRole ());
50+ $ this ->assertEquals ('123 ' , $ role ->getIdentifier ());
51+ $ this ->assertEquals ('project-456 ' , $ role ->getDimension ());
52+
4353 $ role = Role::parse ('user:123/verified ' );
4454 $ this ->assertEquals ('user ' , $ role ->getRole ());
4555 $ this ->assertEquals ('123 ' , $ role ->getIdentifier ());
@@ -76,6 +86,12 @@ public function testInputFromParameters(): void
7686 $ role = new Role ('team ' , '123 ' , '456 ' );
7787 $ this ->assertEquals ('team:123/456 ' , $ role ->toString ());
7888
89+ $ role = new Role ('team ' , '123 ' , 'project-456-owner ' );
90+ $ this ->assertEquals ('team:123/project-456-owner ' , $ role ->toString ());
91+
92+ $ role = new Role ('team ' , '123 ' , 'project-456 ' );
93+ $ this ->assertEquals ('team:123/project-456 ' , $ role ->toString ());
94+
7995 $ role = new Role ('label ' , 'vip ' );
8096 $ this ->assertEquals ('label:vip ' , $ role ->toString ());
8197 }
@@ -100,6 +116,12 @@ public function testInputFromRoles(): void
100116 $ role = Role::team (ID ::custom ('123 ' ), '456 ' );
101117 $ this ->assertEquals ('team:123/456 ' , $ role ->toString ());
102118
119+ $ role = Role::team (ID ::custom ('123 ' ), 'project-456-owner ' );
120+ $ this ->assertEquals ('team:123/project-456-owner ' , $ role ->toString ());
121+
122+ $ role = Role::team (ID ::custom ('123 ' ), 'project-456 ' );
123+ $ this ->assertEquals ('team:123/project-456 ' , $ role ->toString ());
124+
103125 $ role = Role::label ('vip ' );
104126 $ this ->assertEquals ('label:vip ' , $ role ->toString ());
105127 }
0 commit comments