diff --git a/tests/_support/View/SampleClassWithInitController.php b/tests/_support/View/SampleClassWithInitController.php index 531b208dc6d7..32eb4f70a7a3 100644 --- a/tests/_support/View/SampleClassWithInitController.php +++ b/tests/_support/View/SampleClassWithInitController.php @@ -23,6 +23,8 @@ */ class SampleClassWithInitController { + private ResponseInterface $response; + public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { $this->response = $response; diff --git a/tests/system/Models/GeneralModelTest.php b/tests/system/Models/GeneralModelTest.php index 450d3cc87d60..a574f5c37967 100644 --- a/tests/system/Models/GeneralModelTest.php +++ b/tests/system/Models/GeneralModelTest.php @@ -71,10 +71,6 @@ public function testMagicGetters(): void $this->assertFalse(isset($this->model->foobar)); $this->assertNull($this->model->foobar); - $this->model->flavor = 'chocolate'; - $this->assertTrue(isset($this->model->flavor)); - $this->assertSame('chocolate', $this->model->flavor); - // from DB $this->assertTrue(isset($this->model->DBPrefix)); $this->assertSame('utf8', $this->model->charset); diff --git a/tests/system/Models/ValidationModelTest.php b/tests/system/Models/ValidationModelTest.php index 083476326aef..4eacc56255e0 100644 --- a/tests/system/Models/ValidationModelTest.php +++ b/tests/system/Models/ValidationModelTest.php @@ -238,26 +238,25 @@ public function testValidationPassesWithMissingFields(): void public function testValidationWithGroupName(): void { - $config = new Validation(); + $config = new class () extends Validation { + public $grouptest = [ + 'name' => [ + 'required', + 'min_length[3]', + ], + 'token' => 'in_list[{id}]', + ]; + }; + Factories::injectMock('config', 'Validation', $config); - $config->grouptest = [ - 'name' => [ - 'required', - 'min_length[3]', - ], - 'token' => 'in_list[{id}]', - ]; + $this->createModel(ValidModel::class); + $this->setPrivateProperty($this->model, 'validationRules', 'grouptest'); $data = [ 'name' => 'abc', 'id' => 13, 'token' => 13, ]; - - Factories::injectMock('config', 'Validation', $config); - - $this->createModel(ValidModel::class); - $this->setPrivateProperty($this->model, 'validationRules', 'grouptest'); $this->assertTrue($this->model->validate($data)); } diff --git a/tests/system/View/CellTest.php b/tests/system/View/CellTest.php index 43326df4e5ce..0697b8258eaf 100644 --- a/tests/system/View/CellTest.php +++ b/tests/system/View/CellTest.php @@ -249,6 +249,9 @@ public function testParametersDontMatch() public function testCallInitControllerIfMethodExists() { - $this->assertSame(Response::class, $this->cell->render('\Tests\Support\View\SampleClassWithInitController::index')); + $this->assertSame( + Response::class, + $this->cell->render('\Tests\Support\View\SampleClassWithInitController::index') + ); } }