Skip to content

Commit c610bb1

Browse files
committed
Fix asserted Model class
1 parent 5f50c51 commit c610bb1

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

tests/_support/Models/BarModel.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/**
4+
* This file is part of CodeIgniter 4 framework.
5+
*
6+
* (c) CodeIgniter Foundation <admin@codeigniter.com>
7+
*
8+
* For the full copyright and license information, please view
9+
* the LICENSE file that was distributed with this source code.
10+
*/
11+
12+
namespace Tests\Support\Models;
13+
14+
use CodeIgniter\Model;
15+
16+
class BarModel extends Model
17+
{
18+
}

tests/_support/PHPStan/Type/model.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
* the LICENSE file that was distributed with this source code.
1010
*/
1111

12-
use Tests\Support\Models\EntityModel;
13-
1412
use function PHPStan\Testing\assertType;
1513

1614
$class = (static fn (): string => mt_rand(0, 10) > 5 ? stdClass::class : 'Foo')();
1715

1816
assertType('null', model('foo'));
1917
assertType('stdClass', model(stdClass::class));
2018
assertType('Closure', model(Closure::class));
21-
assertType('Tests\Support\Models\EntityModel', model(EntityModel::class));
22-
assertType('Tests\Support\Models\EntityModel', model('EntityModel'));
2319
assertType('null', model('App'));
2420
assertType('object|null', model($class));
21+
22+
// don't use test models used in other tests, as MemoizingReflectionProvider
23+
// messes autoload causing unknown class errors
24+
assertType('Tests\Support\Models\BarModel', model('BarModel'));

0 commit comments

Comments
 (0)