Skip to content

Commit a0f7fae

Browse files
authored
[12.x] Fix visibility of setUp and tearDown in tests (laravel#54950)
* Change visibility from public to protected * remove tearDown method
1 parent 80af327 commit a0f7fae

9 files changed

+8
-13
lines changed

tests/Database/DatabaseConcernsPreventsCircularRecursionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class DatabaseConcernsPreventsCircularRecursionTest extends TestCase
1010
{
11-
public function setUp(): void
11+
protected function setUp(): void
1212
{
1313
parent::setUp();
1414

tests/Database/DatabaseEloquentBelongsToManyCreateOrFirstTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class DatabaseEloquentBelongsToManyCreateOrFirstTest extends TestCase
2121
{
22-
public function setUp(): void
22+
protected function setUp(): void
2323
{
2424
Carbon::setTestNow('2023-01-01 00:00:00');
2525
}

tests/Database/DatabaseEloquentBuilderCreateOrFirstTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class DatabaseEloquentBuilderCreateOrFirstTest extends TestCase
1717
{
18-
public function setUp(): void
18+
protected function setUp(): void
1919
{
2020
Carbon::setTestNow('2023-01-01 00:00:00');
2121
}

tests/Database/DatabaseEloquentHasManyCreateOrFirstTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class DatabaseEloquentHasManyCreateOrFirstTest extends TestCase
1818
{
19-
public function setUp(): void
19+
protected function setUp(): void
2020
{
2121
Carbon::setTestNow('2023-01-01 00:00:00');
2222
}

tests/Database/DatabaseEloquentHasManyThroughCreateOrFirstTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class DatabaseEloquentHasManyThroughCreateOrFirstTest extends TestCase
2020
{
21-
public function setUp(): void
21+
protected function setUp(): void
2222
{
2323
Carbon::setTestNow('2023-01-01 00:00:00');
2424
}

tests/Foundation/Configuration/ExceptionsTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313

1414
class ExceptionsTest extends TestCase
1515
{
16-
public function tearDown(): void
17-
{
18-
parent::tearDown();
19-
}
20-
2116
public function testStopIgnoring()
2217
{
2318
$container = new Container;

tests/Foundation/Configuration/MiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class MiddlewareTest extends TestCase
2323
{
24-
public function tearDown(): void
24+
protected function tearDown(): void
2525
{
2626
parent::tearDown();
2727

tests/Integration/Queue/DynamoBatchTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#[RequiresEnv('DYNAMODB_ENDPOINT')]
2020
class DynamoBatchTest extends TestCase
2121
{
22-
public function setUp(): void
22+
protected function setUp(): void
2323
{
2424
$this->afterApplicationCreated(function () {
2525
BatchRunRecorder::reset();

tests/Queue/DatabaseFailedJobProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class DatabaseFailedJobProviderTest extends TestCase
1818

1919
protected $provider;
2020

21-
public function setUp(): void
21+
protected function setUp(): void
2222
{
2323
parent::setUp();
2424
$this->createDatabaseWithFailedJobTable()

0 commit comments

Comments
 (0)