In some of our testcases we use anonymous classes. When creating an anonymous readonly class, this class issues a warning. The tests run fine though.
What do you get instead?
vendor/bin/codecept run
Codeception PHP Testing Framework v5.1.2
Uninitialized string offset 1 at /var/www/api/vendor/codeception/codeception/src/Codeception/Lib/Parser.php:160
Provide test source code if related
<?php
namespace Shared\Tests\Unit\Domain\ValueObject;
use Throwable;
final class AbstractCollectionTest extends \Codeception\Test\Unit
{
protected UnitTester $tester;
public function testCreateVo(): void
{
try {
new readonly class (12) extends AbstractValueObject {
public function __construct(
public mixed $value,
) {}
};
$this->tester->assertTrue(true);
} catch (Throwable $e) {
$this->tester->fail($e->getMessage());
}
}
}
Details
Codeception version: 5.1.2
PHP Version: 8.3
Operating System: MacOS
Installation type: Composer
Suite configuration:
# Codeception Test Suite Configuration
#
# Suite for unit or integration tests.
actor: UnitTester
modules:
enabled:
- Asserts
step_decorators: ~
What are you trying to achieve?
In some of our testcases we use anonymous classes. When creating an anonymous readonly class, this class issues a warning. The tests run fine though.
What do you get instead?
Details
Codeception version: 5.1.2
PHP Version: 8.3
Operating System: MacOS
Installation type: Composer
Suite configuration: