Issue: Could not bind closure.
PHP version: 8.2.13
Operating system: Linux
str_replace(): Argument #3 ($subject) must be of type array|string, null given
How to Reproduce
new test:
UserUnitTest.php
<?php
use App\Api\User\Models\UserModel;
test('check fillable', static function () {
$userModel = new UserModel();
$arrayCompared = [
'name',
'email',
'password',
'active',
'confirmed_at',
];
checkFillableModels($userModel::class, $userModel->getFillable(), $arrayCompared);
});
in Pest.php, was created
function checkFillableModels(string $modelClass, array $modelFillable, array $arrayCompared): void
{
$diff = array_diff($modelFillable, $arrayCompared);
if (count($diff) > 0) {
$implode = implode(', ', $diff);
throw new ExpectationFailedException("Found diff array '$implode' in the mode: " . $modelClass);
}
assertCount(0, $diff);
}
What Happened
Issue: Could not bind closure. PHP version: 8.2.13 Operating system: Linux str_replace(): Argument #3 ($subject) must be of type array|string, null given
How to Reproduce
new test:
UserUnitTest.php
in Pest.php, was created
composer.php
Sample Repository
No response
Pest Version
2.29
PHP Version
8.2.13
Operation System
Linux
Notes
No response