Skip to content

Commit 9ac5fcc

Browse files
committed
Fix deprecations for tests and sync bootstrap with the example app
Ref: https://github.com/cakephp/app/tree/5.x/tests
1 parent 65c3978 commit 9ac5fcc

20 files changed

Lines changed: 100 additions & 80 deletions

tests/Fixture/DevelopersFixture.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ class DevelopersFixture extends TestFixture
1818

1919
/**
2020
* Records.
21-
*
22-
* @var array
2321
*/
24-
public $records = [
22+
public array $records = [
2523
[
2624
'id' => 1,
2725
'github_id' => 1,

tests/Fixture/IncidentsFixture.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ class IncidentsFixture extends TestFixture
1818

1919
/**
2020
* Records.
21-
*
22-
* @var array
2321
*/
24-
public $records = [
22+
public array $records = [
2523
[
2624
'id' => 1,
2725
'error_name' => 'Lorem ipsum dolor sit amet',

tests/Fixture/NotificationsFixture.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ class NotificationsFixture extends TestFixture
1818

1919
/**
2020
* Records.
21-
*
22-
* @var array
2321
*/
24-
public $records = [
22+
public array $records = [
2523
[
2624
'id' => 1,
2725
'developer_id' => 1,

tests/Fixture/ReportsFixture.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
class ReportsFixture extends TestFixture
88
{
9-
/** @var string */
10-
public $connection = 'test';
9+
public string $connection = 'test';
1110

1211
/**
1312
* Imports.
@@ -16,8 +15,7 @@ class ReportsFixture extends TestFixture
1615
*/
1716
public $import = ['table' => 'reports'];
1817

19-
/** @var array */
20-
public $records = [
18+
public array $records = [
2119
[
2220
'id' => 1,
2321
'error_message' => 'Lorem ipsum dolor sit amet',

tests/TestCase/AllTestsTest.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/TestCase/Controller/DevelopersControllerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
namespace App\Test\TestCase\Controller;
2020

21+
use App\Model\Table\DevelopersTable;
2122
use Cake\ORM\TableRegistry;
2223
use Cake\TestSuite\IntegrationTestTrait;
2324
use Cake\TestSuite\TestCase;
@@ -36,12 +37,12 @@ class DevelopersControllerTest extends TestCase
3637
use PHPMock;
3738
use IntegrationTestTrait;
3839

40+
protected DevelopersTable $Developers;
41+
3942
/**
4043
* Fixtures.
41-
*
42-
* @var array
4344
*/
44-
public $fixtures = [
45+
public array $fixtures = [
4546
'app.Developers',
4647
'app.Notifications',
4748
];

tests/TestCase/Controller/EventsControllerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Test\TestCase\Controller;
44

5+
use App\Model\Table\ReportsTable;
56
use Cake\ORM\TableRegistry;
67
use Cake\TestSuite\IntegrationTestTrait;
78
use Cake\TestSuite\TestCase;
@@ -12,12 +13,12 @@ class EventsControllerTest extends TestCase
1213
{
1314
use IntegrationTestTrait;
1415

16+
protected ReportsTable $Reports;
17+
1518
/**
1619
* Fixtures.
17-
*
18-
* @var array
1920
*/
20-
public $fixtures = ['app.Reports'];
21+
public array $fixtures = ['app.Reports'];
2122

2223
public function setUp(): void
2324
{

tests/TestCase/Controller/GithubControllerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
namespace App\Test\TestCase\Controller;
2020

21+
use App\Model\Table\ReportsTable;
2122
use Cake\Core\Configure;
2223
use Cake\ORM\TableRegistry;
2324
use Cake\TestSuite\IntegrationTestTrait;
@@ -38,12 +39,12 @@ class GithubControllerTest extends TestCase
3839
use PHPMock;
3940
use IntegrationTestTrait;
4041

42+
protected ReportsTable $Reports;
43+
4144
/**
4245
* Fixtures.
43-
*
44-
* @var array
4546
*/
46-
public $fixtures = [
47+
public array $fixtures = [
4748
'app.Reports',
4849
'app.Developers',
4950
'app.Incidents',

tests/TestCase/Controller/IncidentsControllerTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Test\TestCase\Controller;
44

55
use App\Model\Table\IncidentsTable;
6+
use App\Model\Table\ReportsTable;
67
use Cake\Core\Configure;
78
use Cake\ORM\TableRegistry;
89
use Cake\TestSuite\IntegrationTestTrait;
@@ -18,12 +19,13 @@ class IncidentsControllerTest extends TestCase
1819
{
1920
use IntegrationTestTrait;
2021

22+
protected IncidentsTable $Incidents;
23+
protected ReportsTable $Reports;
24+
2125
/**
2226
* Fixtures.
23-
*
24-
* @var array
2527
*/
26-
public $fixtures = [
28+
public array $fixtures = [
2729
'app.Notifications',
2830
'app.Developers',
2931
'app.Reports',

tests/TestCase/Controller/NotificationsControllerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Test\TestCase\Controller;
44

5+
use App\Model\Table\NotificationsTable;
56
use Cake\ORM\TableRegistry;
67
use Cake\TestSuite\IntegrationTestTrait;
78
use Cake\TestSuite\TestCase;
@@ -15,12 +16,12 @@ class NotificationsControllerTest extends TestCase
1516
{
1617
use IntegrationTestTrait;
1718

19+
protected NotificationsTable $Notifications;
20+
1821
/**
1922
* Fixtures.
20-
*
21-
* @var array
2223
*/
23-
public $fixtures = [
24+
public array $fixtures = [
2425
'app.Notifications',
2526
'app.Developers',
2627
'app.Reports',

0 commit comments

Comments
 (0)