the browser-facing portion of osu!
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Change data provider to static method

Non-static is deprecated in phpunit 10.

Also:
- updated phpunit dusk schema
- skip creating app in provider if possible
- move base64url to its own class (helper isn't available)
- use Arr::random instead of array_rand_val
- use config in a callback
- read config file directly instead of relying on config function
- change some test class helpers to static method

nanaya d98f81eb 0687a975

+225 -209
+23
app/Libraries/Base64Url.php
··· 1 + <?php 2 + 3 + // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 4 + // See the LICENCE file in the repository root for full licence text. 5 + 6 + declare(strict_types=1); 7 + 8 + namespace App\Libraries; 9 + 10 + class Base64Url 11 + { 12 + public static function decode(string $value): ?string 13 + { 14 + return null_if_false(base64_decode(strtr($value, '-_', '+/'), true)); 15 + } 16 + 17 + public static function encode(string $value): string 18 + { 19 + // url safe base64 20 + // reference: https://datatracker.ietf.org/doc/html/rfc4648#section-5 21 + return rtrim(strtr(base64_encode($value), '+/', '-_'), '='); 22 + } 23 + }
+2 -2
app/Libraries/SignedRandomString.php
··· 14 14 $key = random_bytes($randomSize); 15 15 $hmac = static::hmac($key); 16 16 17 - return base64url_encode($hmac.$key); 17 + return Base64Url::encode($hmac.$key); 18 18 } 19 19 20 20 public static function isValid(string $input): bool 21 21 { 22 - $bin = base64url_decode($input); 22 + $bin = Base64Url::decode($input); 23 23 if ($bin === null) { 24 24 return false; 25 25 }
+3 -14
app/helpers.php
··· 3 3 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 4 4 // See the LICENCE file in the repository root for full licence text. 5 5 6 + use App\Libraries\Base64Url; 6 7 use App\Libraries\LocaleMeta; 7 8 use App\Models\LoginAttempt; 8 9 use Egulias\EmailValidator\EmailValidator; ··· 58 59 $url = $proxy ? proxy_media($url) : $url; 59 60 60 61 return sprintf(' style="background-image:url(\'%s\');" ', e($url)); 61 - } 62 - 63 - function base64url_decode(string $value): ?string 64 - { 65 - return null_if_false(base64_decode(strtr($value, '-_', '+/'), true)); 66 - } 67 - 68 - function base64url_encode(string $value): string 69 - { 70 - // url safe base64 71 - // reference: https://datatracker.ietf.org/doc/html/rfc4648#section-5 72 - return rtrim(strtr(base64_encode($value), '+/', '-_'), '='); 73 62 } 74 63 75 64 function beatmap_timestamp_format($ms) ··· 310 299 function cursor_decode($cursorString): ?array 311 300 { 312 301 if (is_string($cursorString) && present($cursorString)) { 313 - $cursor = json_decode(base64_decode(strtr($cursorString, '-_', '+/'), true), true); 302 + $cursor = json_decode(Base64Url::decode($cursorString) ?? '', true); 314 303 315 304 if (is_array($cursor)) { 316 305 return $cursor; ··· 324 313 { 325 314 return $cursor === null 326 315 ? null 327 - : base64url_encode(json_encode($cursor)); 316 + : Base64Url::encode(json_encode($cursor)); 328 317 } 329 318 330 319 function cursor_for_response(?array $cursor): array
+13 -15
phpunit.dusk.xml
··· 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 - <phpunit backupGlobals="false" 3 - backupStaticAttributes="false" 4 - bootstrap="vendor/autoload.php" 5 - colors="true" 6 - convertErrorsToExceptions="true" 7 - convertNoticesToExceptions="true" 8 - convertWarningsToExceptions="true" 9 - processIsolation="false" 10 - stopOnFailure="false"> 2 + <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 + backupGlobals="false" 4 + backupStaticAttributes="false" 5 + bootstrap="vendor/autoload.php" 6 + colors="true" 7 + convertErrorsToExceptions="true" 8 + convertNoticesToExceptions="true" 9 + convertWarningsToExceptions="true" 10 + processIsolation="false" 11 + stopOnFailure="false" 12 + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" 13 + > 11 14 <extensions> 12 - <extension class="Tests\SeederExtension" /> 15 + <extension class="Tests\SeederExtension"/> 13 16 </extensions> 14 17 <testsuites> 15 18 <testsuite name="Browser Test Suite"> 16 19 <directory suffix="Test.php">./tests/Browser</directory> 17 20 </testsuite> 18 21 </testsuites> 19 - <filter> 20 - <whitelist processUncoveredFilesFromWhitelist="true"> 21 - <directory suffix=".php">./app</directory> 22 - </whitelist> 23 - </filter> 24 22 </phpunit>
+1 -1
tests/BeatmapsetDisqualifyNotificationsTest.php
··· 128 128 } 129 129 #endregion 130 130 131 - public function booleanDataProvider() 131 + public static function booleanDataProvider() 132 132 { 133 133 return [ 134 134 [true],
+4 -7
tests/BroadcastNotificationTest.php
··· 102 102 } 103 103 } 104 104 105 - public function notificationJobClassesDataProvider() 105 + public static function notificationJobClassesDataProvider() 106 106 { 107 - $this->refreshApplication(); 108 - 109 - $path = app()->path('Jobs/Notifications'); 110 - $files = Finder::create()->files()->in($path)->sortByName(); 107 + $files = Finder::create()->files()->in(__DIR__.'/../app/Jobs/Notifications')->sortByName(); 111 108 foreach ($files as $file) { 112 109 $baseName = $file->getBasename(".{$file->getExtension()}"); 113 110 $classes[] = ["\\App\\Jobs\\Notifications\\{$baseName}"]; ··· 116 113 return $classes; 117 114 } 118 115 119 - public function notificationNamesDataProvider() 116 + public static function notificationNamesDataProvider() 120 117 { 121 118 // TODO: move notification names to different class instead of filtering 122 119 $constants = collect((new ReflectionClass(Notification::class))->getReflectionConstants()) ··· 129 126 return $constants->map(fn (ReflectionClassConstant $constant) => [$constant->getValue()])->all(); 130 127 } 131 128 132 - public function userNotificationDetailsDataProvider() 129 + public static function userNotificationDetailsDataProvider() 133 130 { 134 131 return [ 135 132 [null], // for testing defaults.
+2 -2
tests/Browser/SanityTest.php
··· 308 308 } 309 309 } 310 310 311 - public function routesDataProvider() 311 + public static function routesDataProvider() 312 312 { 313 313 static $bypass = [ 314 314 '__clockwork', ··· 321 321 ]; 322 322 static $types = ['user', 'guest']; 323 323 324 - $this->refreshApplication(); 324 + static::createApp(); 325 325 $data = []; 326 326 327 327 foreach (app()->routes->get('GET') as $uri => $route) {
+2 -2
tests/Commands/EsIndexScoresQueueTest.php
··· 63 63 ); 64 64 } 65 65 66 - public function dataProviderForTestParameterValidity(): array 66 + public static function dataProviderForTestParameterValidity(): array 67 67 { 68 68 return [ 69 69 [[], false], ··· 83 83 ]; 84 84 } 85 85 86 - public function dataProviderForTestQueueScores(): array 86 + public static function dataProviderForTestQueueScores(): array 87 87 { 88 88 $userId = 0; 89 89 $setUp = function () use ($userId) {
+2 -2
tests/Commands/ModdingRankCommandTest.php
··· 104 104 } 105 105 106 106 107 - public function rankDataProvider() 107 + public static function rankDataProvider() 108 108 { 109 109 // 1 day ago isn't used because it might or might not be equal to the cutoff depending on how fast it runs. 110 110 return [ ··· 113 113 ]; 114 114 } 115 115 116 - public function rankHybridDataProvider() 116 + public static function rankHybridDataProvider() 117 117 { 118 118 return [ 119 119 // hybrid counts as ruleset with lowest enum value
+1 -1
tests/Controllers/AccountControllerTest.php
··· 231 231 ->assertStatus(422); 232 232 } 233 233 234 - public function dataProviderForUpdateCountry(): array 234 + public static function dataProviderForUpdateCountry(): array 235 235 { 236 236 return [ 237 237 ['_A', '_A', true],
+4 -4
tests/Controllers/BeatmapDiscussionsControllerTest.php
··· 198 198 $this->assertSame($discussionPostCount + 3, BeatmapDiscussionPost::count()); 199 199 } 200 200 201 - public function putVoteDataProvider() 201 + public static function putVoteDataProvider() 202 202 { 203 203 return [ 204 204 ['graveyard', 403, 0], ··· 211 211 ]; 212 212 } 213 213 214 - public function putVoteAgainDataProvider() 214 + public static function putVoteAgainDataProvider() 215 215 { 216 216 return [ 217 217 'voting again has no effect' => ['1', 0], ··· 219 219 ]; 220 220 } 221 221 222 - public function putVoteChangeToDownDataProvider() 222 + public static function putVoteChangeToDownDataProvider() 223 223 { 224 224 return [ 225 225 'bng can change to down vote' => ['bng', 200, -2], ··· 227 227 ]; 228 228 } 229 229 230 - public function putVoteDownDataProvider() 230 + public static function putVoteDownDataProvider() 231 231 { 232 232 return [ 233 233 'bng can down vote' => ['bng', 200, 1, -1],
+1 -1
tests/Controllers/BeatmapsControllerSoloScoresTest.php
··· 202 202 } 203 203 } 204 204 205 - public function dataProviderForTestQuery(): array 205 + public static function dataProviderForTestQuery(): array 206 206 { 207 207 return [ 208 208 'no parameters' => [[
+2 -2
tests/Controllers/BeatmapsControllerTest.php
··· 594 594 $this->assertSame($beatmapsetEventCount, BeatmapsetEvent::count()); 595 595 } 596 596 597 - public function dataProviderForTestLookupForApi(): array 597 + public static function dataProviderForTestLookupForApi(): array 598 598 { 599 599 return [ 600 600 'checksum' => ['checksum', fn (Beatmap $b) => $b->checksum], ··· 603 603 ]; 604 604 } 605 605 606 - public function dataProviderForTestUpdateOwnerLoved(): array 606 + public static function dataProviderForTestUpdateOwnerLoved(): array 607 607 { 608 608 return [ 609 609 [Beatmapset::STATES['graveyard'], true],
+4 -4
tests/Controllers/BeatmapsetsControllerTest.php
··· 330 330 $this->assertSame($expectedTags, $beatmapset->fresh()->tags); 331 331 } 332 332 333 - public function beatmapsetStatesDataProvider() 333 + public static function beatmapsetStatesDataProvider() 334 334 { 335 335 return array_map(function ($state) { 336 336 return [$state]; 337 337 }, array_keys(Beatmapset::STATES)); 338 338 } 339 339 340 - public function dataProviderForTestBeatmapsetUpdateOffset(): array 340 + public static function dataProviderForTestBeatmapsetUpdateOffset(): array 341 341 { 342 342 return [ 343 343 ['admin', true], ··· 349 349 ]; 350 350 } 351 351 352 - public function dataProviderForTestBeatmapsetUpdateTags(): array 352 + public static function dataProviderForTestBeatmapsetUpdateTags(): array 353 353 { 354 354 return [ 355 355 ['admin', true], ··· 361 361 ]; 362 362 } 363 363 364 - public function dataProviderForTestBeatmapsetUpdateDescriptionAsOwner(): array 364 + public static function dataProviderForTestBeatmapsetUpdateDescriptionAsOwner(): array 365 365 { 366 366 return [ 367 367 [false, null, true],
+1 -1
tests/Controllers/Chat/ChannelsControllerTest.php
··· 378 378 379 379 //endregion 380 380 381 - public function dataProvider() 381 + public static function dataProvider() 382 382 { 383 383 return [ 384 384 ['private', false],
+3 -3
tests/Controllers/Chat/ChatControllerTest.php
··· 288 288 289 289 //endregion 290 290 291 - public function createPmWithAuthorizedGrantDataProvider() 291 + public static function createPmWithAuthorizedGrantDataProvider() 292 292 { 293 293 return [ 294 294 [['*'], 200], ··· 297 297 ]; 298 298 } 299 299 300 - public function createPmWithClientCredentialsDataProvider() 300 + public static function createPmWithClientCredentialsDataProvider() 301 301 { 302 302 return [ 303 303 // TODO: need to add test that validates auth guard calls Token::validate ··· 305 305 ]; 306 306 } 307 307 308 - public function createPmWithClientCredentialsBotGroupDataProvider() 308 + public static function createPmWithClientCredentialsBotGroupDataProvider() 309 309 { 310 310 return [ 311 311 [['chat.write', 'delegate'], 200],
+2 -2
tests/Controllers/CommentsControllerTest.php
··· 250 250 ->assertUnauthorized(); 251 251 } 252 252 253 - public function apiRequiresAuthenticationDataProvider() 253 + public static function apiRequiresAuthenticationDataProvider() 254 254 { 255 255 return [ 256 256 ['DELETE', 'comments.vote'], ··· 270 270 * - Whether the commentable already has a pinned comment 271 271 * - Whether pinning should be allowed 272 272 */ 273 - public function pinPermissionsDataProvider(): array 273 + public static function pinPermissionsDataProvider(): array 274 274 { 275 275 return [ 276 276 ['admin', true, true, true, true, true],
+1 -1
tests/Controllers/InterOp/UserGroupsControllerTest.php
··· 370 370 ->assertStatus(404); 371 371 } 372 372 373 - public function userGroupRoutesDataProvider(): array 373 + public static function userGroupRoutesDataProvider(): array 374 374 { 375 375 return [ 376 376 'add' =>
+1 -1
tests/Controllers/LegacyApiKeyControllerTest.php
··· 98 98 $this->post(route('legacy-api-key.store'))->assertStatus(401); 99 99 } 100 100 101 - public function dataProviderForStoreWithInvalidParams(): array 101 + public static function dataProviderForStoreWithInvalidParams(): array 102 102 { 103 103 return [ 104 104 [[
+2 -2
tests/Controllers/Multiplayer/Rooms/Playlist/ScoresControllerTest.php
··· 145 145 $this->json('PUT', $url, $bodyParams)->assertStatus($status); 146 146 } 147 147 148 - public function dataProviderForTestStore() 148 + public static function dataProviderForTestStore() 149 149 { 150 150 return [ 151 151 'ok' => [true, true, 200], ··· 155 155 ]; 156 156 } 157 157 158 - public function dataProviderForTestUpdate() 158 + public static function dataProviderForTestUpdate() 159 159 { 160 160 static $validBodyParams = [ 161 161 'accuracy' => 1,
+7 -6
tests/Controllers/Multiplayer/RoomsControllerTest.php
··· 15 15 use App\Models\Multiplayer\UserScoreAggregate; 16 16 use App\Models\OAuth\Token; 17 17 use App\Models\User; 18 + use Illuminate\Support\Arr; 18 19 use Tests\TestCase; 19 20 20 21 class RoomsControllerTest extends TestCase ··· 428 429 $this->assertSame($initialUserChannelCount + 1, UserChannel::count()); 429 430 } 430 431 431 - public function dataProviderForTestStoreWithInvalidPlayableMods(): array 432 + public static function dataProviderForTestStoreWithInvalidPlayableMods(): array 432 433 { 433 434 $ret = []; 434 - foreach ([array_rand_val(Room::REALTIME_TYPES), Room::PLAYLIST_TYPE] as $type) { 435 + foreach ([Arr::random(Room::REALTIME_TYPES), Room::PLAYLIST_TYPE] as $type) { 435 436 foreach (['allowed', 'required'] as $modType) { 436 437 $ret[] = [$type, $modType]; 437 438 } ··· 440 441 return $ret; 441 442 } 442 443 443 - public function dataProviderForTestStoreWithInvalidRealtimeAllowedMods(): array 444 + public static function dataProviderForTestStoreWithInvalidRealtimeAllowedMods(): array 444 445 { 445 446 return [ 446 - [array_rand_val(Room::REALTIME_TYPES), false], 447 + [Arr::random(Room::REALTIME_TYPES), false], 447 448 [Room::PLAYLIST_TYPE, true], 448 449 ]; 449 450 } 450 451 451 - public function dataProviderForTestStoreWithInvalidRealtimeMods(): array 452 + public static function dataProviderForTestStoreWithInvalidRealtimeMods(): array 452 453 { 453 454 return [ 454 - [array_rand_val(Room::REALTIME_TYPES), false], 455 + [Arr::random(Room::REALTIME_TYPES), false], 455 456 [Room::PLAYLIST_TYPE, true], 456 457 ]; 457 458 }
+1 -1
tests/Controllers/OAuth/ClientsControllerTest.php
··· 122 122 $this->assertSame('https://nowhere.local', $this->client->redirect); 123 123 } 124 124 125 - public function emptyStringsTestDataProvider() 125 + public static function emptyStringsTestDataProvider() 126 126 { 127 127 return [ 128 128 [null, 'https://nowhere.local'],
+2 -2
tests/Controllers/ScoreTokensControllerTest.php
··· 90 90 ]); 91 91 } 92 92 93 - public function dataProviderForTestStore(): array 93 + public static function dataProviderForTestStore(): array 94 94 { 95 95 return [ 96 96 ['deleted', 404], ··· 101 101 ]; 102 102 } 103 103 104 - public function dataProviderForTestStoreInvalidParameter(): array 104 + public static function dataProviderForTestStoreInvalidParameter(): array 105 105 { 106 106 return [ 107 107 'invalid build hash' => ['version_hash', md5('invalid_'), 422],
+1 -1
tests/Controllers/UsersControllerTest.php
··· 332 332 ->assertSuccessful(); 333 333 } 334 334 335 - public function dataProviderForStoreWebInvalidParams(): array 335 + public static function dataProviderForStoreWebInvalidParams(): array 336 336 { 337 337 return [ 338 338 ['user1', 'user@email.com', 'user@email.com', 'short', 'short'],
+9 -4
tests/CreatesApplication.php
··· 9 9 10 10 trait CreatesApplication 11 11 { 12 + public static function createApp() 13 + { 14 + $app = require __DIR__.'/../bootstrap/app.php'; 15 + $app->make(Kernel::class)->bootstrap(); 16 + 17 + return $app; 18 + } 19 + 12 20 /** 13 21 * Creates the application. 14 22 * ··· 16 24 */ 17 25 public function createApplication() 18 26 { 19 - $app = require __DIR__.'/../bootstrap/app.php'; 20 - $app->make(Kernel::class)->bootstrap(); 21 - 22 - return $app; 27 + return static::createApp(); 23 28 } 24 29 }
+2 -2
tests/HelpersTest.php
··· 56 56 $this->assertTrue(is_sql_unique_exception($exception)); 57 57 } 58 58 59 - public function dataForClassWithModifiers(): array 59 + public static function dataForClassWithModifiers(): array 60 60 { 61 61 return [ 62 62 'no modifiers' => ··· 84 84 ]; 85 85 } 86 86 87 - public function dataForGetStringSplit(): array 87 + public static function dataForGetStringSplit(): array 88 88 { 89 89 return [ 90 90 ["hello\nworld\n!", ['hello', 'world', '!']],
+2 -2
tests/Libraries/BBCodeForDBTest.php
··· 72 72 $this->assertSame($expectedOutput, $output); 73 73 } 74 74 75 - public function examples() 75 + public static function examples() 76 76 { 77 - return $this->fileList(__DIR__.'/bbcode_examples', '.base.txt'); 77 + return static::fileList(__DIR__.'/bbcode_examples', '.base.txt'); 78 78 } 79 79 80 80 protected function setUp(): void
+4 -4
tests/Libraries/BBCodeFromDBTest.php
··· 40 40 $this->assertStringEqualsFile($expectedFilePath, $text); 41 41 } 42 42 43 - public function examples() 43 + public static function examples() 44 44 { 45 - return $this->fileList(__DIR__.'/bbcode_examples', '.db.txt'); 45 + return static::fileList(__DIR__.'/bbcode_examples', '.db.txt'); 46 46 } 47 47 48 - public function removeQuoteExamples() 48 + public static function removeQuoteExamples() 49 49 { 50 - return $this->fileList(__DIR__.'/bbcode_examples/remove_quotes', '.db.txt'); 50 + return static::fileList(__DIR__.'/bbcode_examples/remove_quotes', '.db.txt'); 51 51 } 52 52 53 53 protected function setUp(): void
+13 -13
tests/Libraries/BeatmapsetDiscussion/DiscussionTest.php
··· 35 35 /** 36 36 * @dataProvider minPlaysVerificationDataProvider 37 37 */ 38 - public function testMinPlaysVerification(?int $minPlays, bool $verified, bool $success) 38 + public function testMinPlaysVerification(\Closure $minPlays, bool $verified, bool $success) 39 39 { 40 40 config()->set('osu.user.post_action_verification', false); 41 41 42 - $user = User::factory()->withPlays($minPlays)->create(); 42 + $user = User::factory()->withPlays($minPlays())->create(); 43 43 $beatmapset = $this->beatmapsetFactory()->create(); 44 44 $beatmapset->watches()->create(['user_id' => User::factory()->create()->getKey()]); 45 45 ··· 284 284 285 285 //endregion 286 286 287 - public function minPlaysVerificationDataProvider() 287 + public static function minPlaysVerificationDataProvider() 288 288 { 289 289 return [ 290 - [config('osu.user.min_plays_for_posting') - 1, false, false], 291 - [config('osu.user.min_plays_for_posting') - 1, true, true], 292 - [null, false, true], 293 - [null, true, true], 290 + [fn () => config('osu.user.min_plays_for_posting') - 1, false, false], 291 + [fn () => config('osu.user.min_plays_for_posting') - 1, true, true], 292 + [fn () => null, false, true], 293 + [fn () => null, true, true], 294 294 ]; 295 295 } 296 296 297 - public function problemOnQualifiedBeatmapsetDataProvider() 297 + public static function problemOnQualifiedBeatmapsetDataProvider() 298 298 { 299 299 return [ 300 300 ['pending', 'Event::assertNotDispatched'], ··· 302 302 ]; 303 303 } 304 304 305 - public function problemOnQualifiedBeatmapsetModesNotificationDataProvider() 305 + public static function problemOnQualifiedBeatmapsetModesNotificationDataProvider() 306 306 { 307 307 return [ 308 308 'with matching notification mode' => ['osu', ['osu'], true], ··· 310 310 ]; 311 311 } 312 312 313 - public function newDiscussionQueuesJobsDataProvider() 313 + public static function newDiscussionQueuesJobsDataProvider() 314 314 { 315 315 return [ 316 316 [ ··· 352 352 ]; 353 353 } 354 354 355 - public function newMapperNoteByOtherUsersDataProvider() 355 + public static function newMapperNoteByOtherUsersDataProvider() 356 356 { 357 357 return [ 358 358 ['bng', true], ··· 363 363 ]; 364 364 } 365 365 366 - public function shouldDisqualifyOrResetNominationsDataProvider() 366 + public static function shouldDisqualifyOrResetNominationsDataProvider() 367 367 { 368 368 return [ 369 369 ['pending', 'bng', 'problem', true], ··· 383 383 ]; 384 384 } 385 385 386 - public function userGroupsDataProvider() 386 + public static function userGroupsDataProvider() 387 387 { 388 388 return [ 389 389 ['admin'],
+6 -6
tests/Libraries/BeatmapsetDiscussion/ReplyTest.php
··· 341 341 $this->assertFalse($discussion->fresh()->resolved); 342 342 } 343 343 344 - public function reopeningProblemDoesNotDisqualifyOrResetNominationsDataProvider() 344 + public static function reopeningProblemDoesNotDisqualifyOrResetNominationsDataProvider() 345 345 { 346 346 return [ 347 347 ['bng', 'pending'], ··· 353 353 ]; 354 354 } 355 355 356 - public function replyQueuesNotificationDataProviderToStarter() 356 + public static function replyQueuesNotificationDataProviderToStarter() 357 357 { 358 358 return [ 359 359 ['praise', false], ··· 362 362 ]; 363 363 } 364 364 365 - public function resolveDiscussionByStarterDataProvider() 365 + public static function resolveDiscussionByStarterDataProvider() 366 366 { 367 367 return [ 368 368 ['praise', false], ··· 371 371 ]; 372 372 } 373 373 374 - public function resolveDiscussionByMapperDataProvider() 374 + public static function resolveDiscussionByMapperDataProvider() 375 375 { 376 376 return [ 377 377 ['pending', true], ··· 379 379 ]; 380 380 } 381 381 382 - public function resolveDiscussionByOtherUsersDataProvider() 382 + public static function resolveDiscussionByOtherUsersDataProvider() 383 383 { 384 384 return [ 385 385 ['bng', false], ··· 390 390 ]; 391 391 } 392 392 393 - public function userGroupsDataProvider() 393 + public static function userGroupsDataProvider() 394 394 { 395 395 return [ 396 396 ['admin'],
+1 -1
tests/Libraries/BeatmapsetDiscussion/ReviewTest.php
··· 717 717 718 718 //endregion 719 719 720 - public function dataProviderForQualifiedProblem() 720 + public static function dataProviderForQualifiedProblem() 721 721 { 722 722 return [ 723 723 ['qualified', true],
+5 -5
tests/Libraries/ChatTest.php
··· 265 265 Chat::sendPrivateMessage($sender, $target, 'test message again', false); 266 266 } 267 267 268 - public function createAnnouncementApiDataProvider() 268 + public static function createAnnouncementApiDataProvider() 269 269 { 270 270 return [ 271 271 [null, false, false], ··· 285 285 ]; 286 286 } 287 287 288 - public function minPlaysDataProvider() 288 + public static function minPlaysDataProvider() 289 289 { 290 290 return [ 291 291 'bot group with minplays' => ['bot', true, true], ··· 295 295 ]; 296 296 } 297 297 298 - public function sendPmFriendsOnlyGroupsDataProvider() 298 + public static function sendPmFriendsOnlyGroupsDataProvider() 299 299 { 300 300 return [ 301 301 ['admin', true], ··· 307 307 ]; 308 308 } 309 309 310 - public function sendPmSenderFriendsOnlyGroupsDataProvider() 310 + public static function sendPmSenderFriendsOnlyGroupsDataProvider() 311 311 { 312 312 return [ 313 313 // admin skip because OsuAuthorize skips the check when admin. ··· 319 319 ]; 320 320 } 321 321 322 - public function verifiedDataProvider() 322 + public static function verifiedDataProvider() 323 323 { 324 324 return [ 325 325 [false, VerificationRequiredException::class],
+1 -1
tests/Libraries/Fulfillments/SupporterTagFulfillmentTest.php
··· 291 291 (new SupporterTagFulfillment($this->order))->run(); 292 292 } 293 293 294 - public function boolDataProvider() 294 + public static function boolDataProvider() 295 295 { 296 296 return [ 297 297 [true],
+1 -1
tests/Libraries/Ip2AsnTest.php
··· 18 18 $this->assertSame((new Ip2Asn())->lookup($ip), $asn); 19 19 } 20 20 21 - public function dataProviderForLookup(): array 21 + public static function dataProviderForLookup(): array 22 22 { 23 23 return [ 24 24 'cloudflare 1' => ['2606:4700::6810:85e5', '13335'],
+2 -2
tests/Libraries/Markdown/ChatMarkdownTest.php
··· 22 22 ); 23 23 } 24 24 25 - public function chatExamples() 25 + public static function chatExamples() 26 26 { 27 - return $this->fileList(__DIR__.'/chat_markdown_examples', '.md'); 27 + return static::fileList(__DIR__.'/chat_markdown_examples', '.md'); 28 28 } 29 29 30 30 private function loadOutputTest(string $name, string $path)
+4 -4
tests/Libraries/Markdown/ProcessorTest.php
··· 52 52 $this->assertSame('some header', $parsed['toc']['some-header']['title']); 53 53 } 54 54 55 - public function htmlExamples() 55 + public static function htmlExamples() 56 56 { 57 - return $this->fileList(__DIR__.'/html_markdown_examples', '.md'); 57 + return static::fileList(__DIR__.'/html_markdown_examples', '.md'); 58 58 } 59 59 60 - public function indexableExamples() 60 + public static function indexableExamples() 61 61 { 62 - return $this->fileList(__DIR__.'/indexable_markdown_examples', '.md'); 62 + return static::fileList(__DIR__.'/indexable_markdown_examples', '.md'); 63 63 } 64 64 65 65 private function loadOutputTest(string $name, string $path, string $extension)
+2 -2
tests/Libraries/ModsTest.php
··· 100 100 } 101 101 } 102 102 103 - public function modCombos() 103 + public static function modCombos() 104 104 { 105 105 return [ 106 106 // valid ··· 140 140 ]; 141 141 } 142 142 143 - public function modComboExclusives() 143 + public static function modComboExclusives() 144 144 { 145 145 return [ 146 146 // non-exclusive required mods and no allowed mods
+1 -1
tests/Libraries/Search/BeatmapsetQueryParserTest.php
··· 19 19 $this->assertSame(json_encode($expected), json_encode(BeatmapsetQueryParser::parse($query))); 20 20 } 21 21 22 - public function queryDataProvider() 22 + public static function queryDataProvider() 23 23 { 24 24 return [ 25 25 // basic options
+2 -2
tests/Libraries/Search/BeatmapsetSearchRequestParamsTest.php
··· 59 59 $this->assertSame($expected, $searchAfter); 60 60 } 61 61 62 - public function cursorsDataProvider() 62 + public static function cursorsDataProvider() 63 63 { 64 64 return [ 65 65 [null, null, false, null], ··· 74 74 ]; 75 75 } 76 76 77 - public function cursorsGuestDataProvider() 77 + public static function cursorsGuestDataProvider() 78 78 { 79 79 return [ 80 80 [null, null, false, null],
+3 -2
tests/Libraries/SignedRandomStringTest.php
··· 7 7 8 8 namespace Tests\Libraries; 9 9 10 + use App\Libraries\Base64Url; 10 11 use App\Libraries\SignedRandomString; 11 12 use Tests\TestCase; 12 13 ··· 25 26 $this->assertFalse(SignedRandomString::isValid($value)); 26 27 } 27 28 28 - public function dataProviderForTestIsValidInvalid(): array 29 + public static function dataProviderForTestIsValidInvalid(): array 29 30 { 30 31 return [ 31 32 ['invalid'], 32 33 [''], 33 - [base64url_encode('test')], 34 + [Base64Url::encode('test')], 34 35 ]; 35 36 } 36 37 }
+3 -3
tests/Libraries/UsernameValidationTest.php
··· 179 179 * - Beatmap or beatmapset state 180 180 * - Whether the username should be available 181 181 */ 182 - public function usernameAvailabilityWithBeatmapStateDataProvider(): array 182 + public static function usernameAvailabilityWithBeatmapStateDataProvider(): array 183 183 { 184 184 return [ 185 185 ['graveyard', true], ··· 197 197 * - Username 198 198 * - Whether the username should be valid 199 199 */ 200 - public function usernameValidationDataProvider(): array 200 + public static function usernameValidationDataProvider(): array 201 201 { 202 202 return [ 203 203 'alphabetic' => ['Username', true], ··· 223 223 * - Whether the user lookup should have its underscores replaced with spaces 224 224 * - Whether the user lookup should return the user 225 225 */ 226 - public function usersOfUsernameLookupDataProvider(): array 226 + public static function usersOfUsernameLookupDataProvider(): array 227 227 { 228 228 return [ 229 229 [true, true, false],
+5 -4
tests/LocaleTest.php
··· 145 145 $this->assertSame('fr', App::getLocale()); 146 146 } 147 147 148 - public function availableLocalesProvider() 148 + public static function availableLocalesProvider() 149 149 { 150 - return array_map(function ($locale) { 151 - return [$locale]; 152 - }, config('app.available_locales')); 150 + return array_map( 151 + fn ($locale) => [$locale], 152 + (require __DIR__.'/../config/app.php')['available_locales'], 153 + ); 153 154 } 154 155 }
+2 -2
tests/Middleware/RequireScopesTest.php
··· 112 112 $this->assertTrue(!oauth_token()->isClientCredentials()); 113 113 } 114 114 115 - public function clientCredentialsTestDataProvider() 115 + public static function clientCredentialsTestDataProvider() 116 116 { 117 117 return [ 118 118 'null is not a valid scope' => [null, MissingScopeException::class], ··· 132 132 ]; 133 133 } 134 134 135 - public function userScopesTestDataProvider() 135 + public static function userScopesTestDataProvider() 136 136 { 137 137 return [ 138 138 'All scopes' => [null, ['*'], null],
+8 -9
tests/Middleware/RouteScopesTest.php
··· 72 72 } 73 73 } 74 74 75 - public function routesDataProvider() 75 + public static function routesDataProvider() 76 76 { 77 - // note that $this->app does not carry over to the tests. 78 - $this->refreshApplication(); 77 + static::createApp(); 79 78 80 79 $data = []; 81 80 ··· 103 102 return $data; 104 103 } 105 104 106 - public function routeScopesDataProvider() 105 + public static function routeScopesDataProvider() 107 106 { 108 - // note that $this->app does not carry over to the tests. 109 - $this->refreshApplication(); 107 + static::createApp(); 110 108 111 - return array_map(function ($route) { 112 - return [$route]; 113 - }, (new RouteScopesHelper())->toArray()); 109 + return array_map( 110 + fn ($route) => [$route], 111 + (new RouteScopesHelper())->toArray(), 112 + ); 114 113 } 115 114 116 115 private function importExpectations()
+1 -1
tests/Middleware/ThrottleRequestsTest.php
··· 45 45 ->assertHeader('X-Ratelimit-Remaining', 58); 46 46 } 47 47 48 - public function throttleDataProvider() 48 + public static function throttleDataProvider() 49 49 { 50 50 return [ 51 51 'throttle' => [['throttle:60,10'], 59],
+1 -1
tests/Models/BeatmapDiscussionTest.php
··· 184 184 $this->assertFalse($discussion->trashed()); 185 185 } 186 186 187 - public function validBeatmapsetStatuses() 187 + public static function validBeatmapsetStatuses() 188 188 { 189 189 return array_map(function ($status) { 190 190 return [camel_case($status)];
+1 -1
tests/Models/BeatmapPackUserCompletionTest.php
··· 58 58 $this->assertSame($completed, $data['completed']); 59 59 } 60 60 61 - public function dataProviderForTestBasic(): array 61 + public static function dataProviderForTestBasic(): array 62 62 { 63 63 return [ 64 64 ['convertOsu', 'osu', true],
+3 -3
tests/Models/BeatmapsetTest.php
··· 507 507 508 508 //end region 509 509 510 - public function disqualifyOrResetNominationsDataProvider() 510 + public static function disqualifyOrResetNominationsDataProvider() 511 511 { 512 512 return [ 513 513 ['pending', BeatmapsetResetNominations::class], ··· 515 515 ]; 516 516 } 517 517 518 - public function dataProviderForTestRank(): array 518 + public static function dataProviderForTestRank(): array 519 519 { 520 520 return [ 521 521 ['pending', false], ··· 523 523 ]; 524 524 } 525 525 526 - public function rankWithOpenIssueDataProvider() 526 + public static function rankWithOpenIssueDataProvider() 527 527 { 528 528 return [ 529 529 ['problem'],
+1 -1
tests/Models/ChangelogEntryTest.php
··· 131 131 $this->assertTrue(ChangelogEntry::isPrivate($data)); 132 132 } 133 133 134 - public function dataForPublicMessageHtmlVisibility() 134 + public static function dataForPublicMessageHtmlVisibility() 135 135 { 136 136 return [ 137 137 ['Hidden', null],
+4 -4
tests/Models/Chat/ChannelTest.php
··· 301 301 $this->assertEmpty($memoized); 302 302 } 303 303 304 - public function channelCanMessageModeratedChannelDataProvider() 304 + public static function channelCanMessageModeratedChannelDataProvider() 305 305 { 306 306 return [ 307 307 [null, false], ··· 313 313 ]; 314 314 } 315 315 316 - public function channelCanMessageWhenBlockedDataProvider() 316 + public static function channelCanMessageWhenBlockedDataProvider() 317 317 { 318 318 return [ 319 319 [null, false], ··· 325 325 ]; 326 326 } 327 327 328 - public function channelWithBlockedUserVisibilityDataProvider() 328 + public static function channelWithBlockedUserVisibilityDataProvider() 329 329 { 330 330 return [ 331 331 [null, false], ··· 337 337 ]; 338 338 } 339 339 340 - public function leaveChannelDataProvider() 340 + public static function leaveChannelDataProvider() 341 341 { 342 342 return [ 343 343 ['announce', true],
+2 -2
tests/Models/CommentTest.php
··· 88 88 $this->assertFalse($comment->fresh()->pinned); 89 89 } 90 90 91 - public function commentReplyOptionDataProvider() 91 + public static function commentReplyOptionDataProvider() 92 92 { 93 93 return [ 94 94 [null, true], ··· 97 97 ]; 98 98 } 99 99 100 - public function dataProviderForSetCommentableInvalid() 100 + public static function dataProviderForSetCommentableInvalid() 101 101 { 102 102 return [ 103 103 [null, null],
+2 -2
tests/Models/ContestTest.php
··· 124 124 $this->assertSame($result, $contest->showEntryUser()); 125 125 } 126 126 127 - public function dataProviderForTestAssertVoteRequirementPlaylistBeatmapsets(): array 127 + public static function dataProviderForTestAssertVoteRequirementPlaylistBeatmapsets(): array 128 128 { 129 129 return [ 130 130 // when passing is required ··· 145 145 ]; 146 146 } 147 147 148 - public function dataProviderForTestShowEntryUser(): array 148 + public static function dataProviderForTestShowEntryUser(): array 149 149 { 150 150 return [ 151 151 [false, null, false],
+1 -1
tests/Models/ModelCompositePrimaryKeysTest.php
··· 71 71 $this->assertSame($cast($check[2]), $cast($item2->fresh()->$key)); 72 72 } 73 73 74 - public function dataProviderBase() 74 + public static function dataProviderBase() 75 75 { 76 76 // 0: class name 77 77 // 1: base params
+1 -1
tests/Models/ModelTest.php
··· 130 130 $anotherCountry->refresh(); 131 131 } 132 132 133 - public function dataProviderForDecrementInstance(): array 133 + public static function dataProviderForDecrementInstance(): array 134 134 { 135 135 return [ 136 136 [fn () => Country::factory()->create(), true],
+2 -1
tests/Models/Multiplayer/RoomTest.php
··· 186 186 (new Room())->startGame($user, $params); 187 187 } 188 188 189 - public function startGameDurationDataProvider() 189 + public static function startGameDurationDataProvider() 190 190 { 191 191 static $dayMinutes = 1440; 192 + static::createApp(); 192 193 193 194 $maxDuration = config('osu.user.max_multiplayer_duration'); 194 195 $maxDurationSupporter = config('osu.user.max_multiplayer_duration_supporter');
+1 -1
tests/Models/OAuth/GroupPermissionTest.php
··· 41 41 $this->assertTrue(auth()->user()->$method()); 42 42 } 43 43 44 - public function groupsDataProvider() 44 + public static function groupsDataProvider() 45 45 { 46 46 return [ 47 47 ['admin', 'isAdmin', false],
+6 -6
tests/Models/OAuth/TokenTest.php
··· 192 192 Event::assertDispatched(UserSessionEvent::class, fn (UserSessionEvent $event) => $event->action === 'logout'); 193 193 } 194 194 195 - public function authCodeChatWriteRequiresBotGroupDataProvider() 195 + public static function authCodeChatWriteRequiresBotGroupDataProvider() 196 196 { 197 197 return [ 198 198 [null, InvalidScopeException::class], ··· 204 204 ]; 205 205 } 206 206 207 - public function delegationNotAllowedScopesDataProvider() 207 + public static function delegationNotAllowedScopesDataProvider() 208 208 { 209 209 return Passport::scopes() 210 210 ->pluck('id') ··· 213 213 ->values(); 214 214 } 215 215 216 - public function delegationRequiredScopesDataProvider() 216 + public static function delegationRequiredScopesDataProvider() 217 217 { 218 218 return [ 219 219 'chat.write requires delegation' => [['chat.write'], InvalidScopeException::class], ··· 221 221 ]; 222 222 } 223 223 224 - public function delegationRequiresChatBotDataProvider() 224 + public static function delegationRequiresChatBotDataProvider() 225 225 { 226 226 return [ 227 227 [null, InvalidScopeException::class], ··· 233 233 ]; 234 234 } 235 235 236 - public function scopesDataProvider() 236 + public static function scopesDataProvider() 237 237 { 238 238 return [ 239 239 'null is not a valid scope' => [null, InvalidScopeException::class], ··· 242 242 ]; 243 243 } 244 244 245 - public function scopesClientCredentialsDataProvider() 245 + public static function scopesClientCredentialsDataProvider() 246 246 { 247 247 return [ 248 248 'null is not a valid scope' => [null, InvalidScopeException::class],
+1 -1
tests/Models/Score/ModelTest.php
··· 29 29 Model::getClass($ruleset); 30 30 } 31 31 32 - public function dataProviderForTestGetClassInvalidRuleset(): array 32 + public static function dataProviderForTestGetClassInvalidRuleset(): array 33 33 { 34 34 return [ 35 35 ['does'],
+1 -1
tests/Models/Solo/ScoreEsIndexTest.php
··· 125 125 $this->assertSame($rank, $score->userRank($params)); 126 126 } 127 127 128 - public function dataProviderForTestUserRank(): array 128 + public static function dataProviderForTestUserRank(): array 129 129 { 130 130 return [ 131 131 ['user', null, 4],
+1 -1
tests/Models/Store/OrderItemTest.php
··· 104 104 $this->assertSame($product->stock, 0); 105 105 } 106 106 107 - public function deleteDataProvider() 107 + public static function deleteDataProvider() 108 108 { 109 109 return [ 110 110 ['checkout', InvariantException::class],
+1 -1
tests/Models/UserNotificationTest.php
··· 178 178 ); 179 179 } 180 180 181 - public function deliveryMaskDataProvider() 181 + public static function deliveryMaskDataProvider() 182 182 { 183 183 return [ 184 184 [0, 'mail', false],
+1 -1
tests/Models/UserReportTest.php
··· 192 192 $this->assertTrue(true, 'should not fail getting notification routing url'); 193 193 } 194 194 195 - public function reportableClasses(): array 195 + public static function reportableClasses(): array 196 196 { 197 197 $reportables = []; 198 198
+2 -2
tests/Models/UserStatistics/ModelTest.php
··· 30 30 Model::getClass($mode, $variant); 31 31 } 32 32 33 - public function invalidModes() 33 + public static function invalidModes() 34 34 { 35 35 return [ 36 36 ['does', null], ··· 41 41 ]; 42 42 } 43 43 44 - public function validModes() 44 + public static function validModes() 45 45 { 46 46 $modes = []; 47 47
+2 -2
tests/Models/UserTest.php
··· 104 104 } 105 105 } 106 106 107 - public function dataProviderForAttributeTwitter(): array 107 + public static function dataProviderForAttributeTwitter(): array 108 108 { 109 109 return [ 110 110 ['@hello', 'hello'], ··· 115 115 ]; 116 116 } 117 117 118 - public function dataProviderValidDiscordUsername(): array 118 + public static function dataProviderValidDiscordUsername(): array 119 119 { 120 120 return [ 121 121 ['username', true],
+1 -1
tests/OAuthAuthCodeRequestTest.php
··· 49 49 ->assertStatus(400); 50 50 } 51 51 52 - public function botClientDataProvider() 52 + public static function botClientDataProvider() 53 53 { 54 54 return [ 55 55 'cannot request delegation with auth_code' => ['delegate', false],
+2 -2
tests/OAuthClientCredentialsRequestTest.php
··· 48 48 ->assertStatus($status); 49 49 } 50 50 51 - public function botRequestingScopeDataProvider() 51 + public static function botRequestingScopeDataProvider() 52 52 { 53 53 return [ 54 54 '* cannot be requested' => ['*', 400], ··· 60 60 ]; 61 61 } 62 62 63 - public function nonBotRequestingScopeDataProvider() 63 + public static function nonBotRequestingScopeDataProvider() 64 64 { 65 65 return [ 66 66 '* cannot be requested' => ['*', 400],
+1 -1
tests/Providers/AuthServiceProviderTest.php
··· 37 37 } 38 38 } 39 39 40 - public function oauthRoutesRegisteredDataProvider() 40 + public static function oauthRoutesRegisteredDataProvider() 41 41 { 42 42 return [ 43 43 ['oauth/authorize', 'GET', AuthorizationController::class.'@authorize'],
+10 -9
tests/TestCase.php
··· 34 34 35 35 public static function withDbAccess(callable $callback): void 36 36 { 37 - $db = (new static())->createApplication()->make('db'); 37 + $db = static::createApp()->make('db'); 38 38 39 39 $callback(); 40 40 41 41 static::resetAppDb($db); 42 + } 43 + 44 + protected static function fileList($path, $suffix) 45 + { 46 + return array_map( 47 + fn ($file) => [basename($file, $suffix), $path], 48 + glob("{$path}/*{$suffix}"), 49 + ); 42 50 } 43 51 44 52 protected static function reindexScores() ··· 73 81 74 82 protected array $expectedCountsCallbacks = []; 75 83 76 - public function regularOAuthScopesDataProvider() 84 + public static function regularOAuthScopesDataProvider() 77 85 { 78 86 $data = []; 79 87 ··· 265 273 'expected' => $callback() + $change, 266 274 'message' => $message, 267 275 ]; 268 - } 269 - 270 - protected function fileList($path, $suffix) 271 - { 272 - return array_map(function ($file) use ($path, $suffix) { 273 - return [basename($file, $suffix), $path]; 274 - }, glob("{$path}/*{$suffix}")); 275 276 } 276 277 277 278 protected function inReceivers(Model $model, NewPrivateNotificationEvent|BroadcastNotificationBase $obj): bool
+1 -1
tests/Transformers/BeatmapDiscussionPostTransformerTest.php
··· 48 48 } 49 49 } 50 50 51 - public function groupsDataProvider() 51 + public static function groupsDataProvider() 52 52 { 53 53 return [ 54 54 ['admin', true],
+1 -1
tests/Transformers/BeatmapDiscussionTransformerTest.php
··· 44 44 } 45 45 } 46 46 47 - public function groupsDataProvider() 47 + public static function groupsDataProvider() 48 48 { 49 49 return [ 50 50 ['admin', true],
+1 -1
tests/Transformers/BeatmapTransformerTest.php
··· 45 45 } 46 46 } 47 47 48 - public function groupsDataProvider() 48 + public static function groupsDataProvider() 49 49 { 50 50 return [ 51 51 ['admin', true],
+1 -1
tests/Transformers/BeatmapsetCompactTransformerTest.php
··· 64 64 $this->assertArrayHasKey($property, $json); 65 65 } 66 66 67 - public function propertyPermissionsDataProvider() 67 + public static function propertyPermissionsDataProvider() 68 68 { 69 69 $data = []; 70 70 $transformer = new BeatmapsetCompactTransformer();
+1 -1
tests/Transformers/BeatmapsetDescriptionTransformerTest.php
··· 72 72 $this->assertArrayNotHasKey('bbcode', $json); 73 73 } 74 74 75 - public function groupsDataProvider() 75 + public static function groupsDataProvider() 76 76 { 77 77 return [ 78 78 ['admin', true],
+1 -1
tests/Transformers/BeatmapsetEventTransformerTest.php
··· 57 57 } 58 58 } 59 59 60 - public function dataProvider() 60 + public static function dataProvider() 61 61 { 62 62 // one event type of each priviledge type. 63 63 return [
+1 -1
tests/Transformers/BeatmapsetTransformerTest.php
··· 43 43 } 44 44 } 45 45 46 - public function groupsDataProvider() 46 + public static function groupsDataProvider() 47 47 { 48 48 return [ 49 49 ['admin', true],
+1 -1
tests/Transformers/CommentTransformerTest.php
··· 46 46 } 47 47 } 48 48 49 - public function groupsDataProvider() 49 + public static function groupsDataProvider() 50 50 { 51 51 return [ 52 52 ['admin', true],
+2 -2
tests/Transformers/DeclaredPermissionsTest.php
··· 38 38 $this->assertTrue(method_exists(app('OsuAuthorize'), "check{$privilege}"), "{$class} uses check{$privilege} but is not implemented."); 39 39 } 40 40 41 - public function transformerClassesDataProvider() 41 + public static function transformerClassesDataProvider() 42 42 { 43 43 return array_map( 44 44 function ($class) { ··· 48 48 ); 49 49 } 50 50 51 - public function privilegeDataProvider() 51 + public static function privilegeDataProvider() 52 52 { 53 53 $data = []; 54 54
+1 -1
tests/Transformers/OAuth/ClientTransformerTest.php
··· 48 48 $this->assertArrayNotHasKey('secret', $json); 49 49 } 50 50 51 - public function groupsDataProvider() 51 + public static function groupsDataProvider() 52 52 { 53 53 return [ 54 54 ['admin'],
+1 -1
tests/Transformers/PollOptionTransformerTest.php
··· 64 64 * - Authenticated user's group identifier 65 65 * - Whether vote count should be visible 66 66 */ 67 - public function voteCountPermissionsDataProvider(): array 67 + public static function voteCountPermissionsDataProvider(): array 68 68 { 69 69 return [ 70 70 [true, true, true, 'admin', true],
+2 -2
tests/Transformers/UserCompactTransformerTest.php
··· 109 109 $this->assertArrayHasKey($property, $json); 110 110 } 111 111 112 - public function groupsDataProvider() 112 + public static function groupsDataProvider() 113 113 { 114 114 return [ 115 115 ['admin', true], ··· 120 120 ]; 121 121 } 122 122 123 - public function propertyPermissionsDataProvider() 123 + public static function propertyPermissionsDataProvider() 124 124 { 125 125 $data = []; 126 126 $transformer = new UserTransformer();
+1 -1
tests/ZalgoTest.php
··· 50 50 ]; 51 51 } 52 52 53 - public function zalgoExamples() 53 + public static function zalgoExamples() 54 54 { 55 55 return [ 56 56 ['testing', 0],