Skip to content

Commit f5069f0

Browse files
committed
test: use anonymous class instead of concrete class
1 parent 26c7daa commit f5069f0

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

tests/_support/Config/Factory.php

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

tests/system/Config/FactoriesTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use CodeIgniter\Test\CIUnitTestCase;
1515
use ReflectionClass;
1616
use stdClass;
17-
use Tests\Support\Config\Factory;
1817
use Tests\Support\Models\UserModel;
1918
use Tests\Support\Widgets\OtherWidget;
2019
use Tests\Support\Widgets\SomeWidget;
@@ -76,8 +75,9 @@ public function testSetsOptions()
7675
public function testUsesConfigOptions()
7776
{
7877
// Simulate having a $widgets property in App\Config\Factory
79-
$config = new Factory();
80-
$config->widgets = ['bar' => 'bam'];
78+
$config = new class () extends Factory {
79+
public $widgets = ['bar' => 'bam'];
80+
};
8181
Factories::injectMock('config', Factory::class, $config);
8282

8383
$result = Factories::getOptions('widgets');

0 commit comments

Comments
 (0)