Skip to content

Commit

Permalink
[11.x] Use PHPUnit Attributes to avoid deprecation notice. (#50291)
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Feb 28, 2024
1 parent 760316f commit 2e98072
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
8 changes: 4 additions & 4 deletions tests/Integration/Database/MySql/JoinLateralTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
use PHPUnit\Framework\Attributes\RequiresOperatingSystemFamily;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;

/**
* @requires extension pdo_mysql
* @requires OS Linux|Darwin
*/
#[RequiresPhpExtension('pdo_mysql')]
#[RequiresOperatingSystemFamily('Linux|Darwin')]
class JoinLateralTest extends MySqlTestCase
{
protected function afterRefreshingDatabase()
Expand Down
8 changes: 4 additions & 4 deletions tests/Integration/Database/Postgres/JoinLateralTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
use PHPUnit\Framework\Attributes\RequiresOperatingSystemFamily;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;

/**
* @requires extension pdo_pgsql
* @requires OS Linux|Darwin
*/
#[RequiresPhpExtension('pdo_pgsql')]
#[RequiresOperatingSystemFamily('Linux|Darwin')]
class JoinLateralTest extends PostgresTestCase
{
protected function afterRefreshingDatabase()
Expand Down
9 changes: 3 additions & 6 deletions tests/Validation/ValidationEnumRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Validation\Rules\Enum;
use Illuminate\Validation\ValidationServiceProvider;
use Illuminate\Validation\Validator;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

include_once 'Enums.php';
Expand Down Expand Up @@ -97,9 +98,7 @@ public function testValidationPassesForAllCasesUntilEitherOnlyOrExceptIsPassed()
$this->assertTrue($v->passes());
}

/**
* @dataProvider conditionalCasesDataProvider
*/
#[DataProvider('conditionalCasesDataProvider')]
public function testValidationPassesWhenOnlyCasesProvided(
IntegerStatus|int $enum,
array|IntegerStatus $only,
Expand All @@ -118,9 +117,7 @@ public function testValidationPassesWhenOnlyCasesProvided(
$this->assertSame($expected, $v->passes());
}

/**
* @dataProvider conditionalCasesDataProvider
*/
#[DataProvider('conditionalCasesDataProvider')]
public function testValidationPassesWhenExceptCasesProvided(
int|IntegerStatus $enum,
array|IntegerStatus $except,
Expand Down

0 comments on commit 2e98072

Please sign in to comment.