1515use Linna \Authentication \Password ;
1616use Linna \Storage \ExtendedPDO ;
1717use Linna \Storage \StorageFactory ;
18+ use PHPUnit \Framework \Attributes \DataProvider ;
1819use PHPUnit \Framework \TestCase ;
1920use Linna \TestHelper \Pdo \PdoOptionsFactory ;
2021
@@ -128,14 +129,13 @@ public static function userRoleProvider(): array
128129 /**
129130 * Test is user in role.
130131 *
131- * @dataProvider userRoleProvider
132- *
133132 * @param int $roleId
134133 * @param int $userId
135134 * @param bool $result
136135 *
137136 * @return void
138137 */
138+ #[DataProvider('userRoleProvider ' )]
139139 public function testIsUserInRole (int $ roleId , int $ userId , bool $ result ): void
140140 {
141141 /** @var RoleExtended Role Class. */
@@ -149,14 +149,13 @@ public function testIsUserInRole(int $roleId, int $userId, bool $result): void
149149 /**
150150 * Test is user in role by id.
151151 *
152- * @dataProvider userRoleProvider
153- *
154152 * @param int $roleId
155153 * @param int $userId
156154 * @param bool $result
157155 *
158156 * @return void
159157 */
158+ #[DataProvider('userRoleProvider ' )]
160159 public function testIsUserInRoleById (int $ roleId , int $ userId , bool $ result ): void
161160 {
162161 /** @var RoleExtended Role Class. */
@@ -168,14 +167,13 @@ public function testIsUserInRoleById(int $roleId, int $userId, bool $result): vo
168167 /**
169168 * Test is user in role by name.
170169 *
171- * @dataProvider userRoleProvider
172- *
173170 * @param int $roleId
174171 * @param int $userId
175172 * @param bool $result
176173 *
177174 * @return void
178175 */
176+ #[DataProvider('userRoleProvider ' )]
179177 public function testIsUserInRoleByName (int $ roleId , int $ userId , bool $ result ): void
180178 {
181179 /** @var RoleExtended Role Class. */
@@ -219,14 +217,13 @@ public static function rolePermissionProvider(): array
219217 /**
220218 * Test role can.
221219 *
222- * @dataProvider rolePermissionProvider
223- *
224220 * @param int $roleId
225221 * @param int $permissionId
226222 * @param bool $result
227223 *
228224 * @return void
229225 */
226+ #[DataProvider('rolePermissionProvider ' )]
230227 public function testRoleCan (int $ roleId , int $ permissionId , bool $ result ): void
231228 {
232229 /** @var RoleExtended Role Class. */
@@ -240,14 +237,13 @@ public function testRoleCan(int $roleId, int $permissionId, bool $result): void
240237 /**
241238 * Test role can by id.
242239 *
243- * @dataProvider rolePermissionProvider
244- *
245240 * @param int $roleId
246241 * @param int $permissionId
247242 * @param bool $result
248243 *
249244 * @return void
250245 */
246+ #[DataProvider('rolePermissionProvider ' )]
251247 public function testRoleCanById (int $ roleId , int $ permissionId , bool $ result ): void
252248 {
253249 /** @var RoleExtended Role Class. */
@@ -259,14 +255,13 @@ public function testRoleCanById(int $roleId, int $permissionId, bool $result): v
259255 /**
260256 * Test role can by name.
261257 *
262- * @dataProvider rolePermissionProvider
263- *
264258 * @param int $roleId
265259 * @param int $permissionId
266260 * @param bool $result
267261 *
268262 * @return void
269263 */
264+ #[DataProvider('rolePermissionProvider ' )]
270265 public function testRoleCanByName (int $ roleId , int $ permissionId , bool $ result ): void
271266 {
272267 /** @var RoleExtended Role Class. */
0 commit comments