Skip to content

Commit

Permalink
Add test for readonly classes emitted in PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Oct 4, 2024
1 parent 07dd3b4 commit e772b3d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/php/lang/ast/unittest/emit/PHP83Test.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php namespace lang\ast\unittest\emit;

use lang\ast\emit\Type;
use test\{Assert, Test};

class PHP83Test extends EmittingTest {

/** @return string */
protected function runtime() { return 'php:8.3.0'; }

#[Test]
public function readonly_classes() {
Assert::matches(
'/readonly class [A-Z0-9]+{/',
$this->emit('readonly class %T { }')
);
}
}

0 comments on commit e772b3d

Please sign in to comment.