Skip to content

Commit

Permalink
Simplify abstract property test
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed May 18, 2024
1 parent 33d6f86 commit 6bfe8c0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/test/php/lang/ast/unittest/parse/MembersTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,13 @@ public function property_with_final_hook() {
}

#[Test]
public function property_with_abstract_hook() {
public function abstract_property_with_hook() {
$class= new ClassDeclaration(['abstract'], new IsValue('\\A'), null, [], [], null, null, self::LINE);
$prop= new Property(['public', 'abstract'], 'a', null, null, null, null, self::LINE);
$parameter= new Parameter('value', new IsLiteral('string'), null, false, false, null, null, null, self::LINE);
$prop->hooks['set']= new Hook([], 'set', null, false, $parameter, self::LINE);
$prop->hooks['set']= new Hook([], 'set', null, false, null, self::LINE);
$class->declare($prop);

$this->assertParsed([$class], 'abstract class A { public abstract $a { set(string $value); } }');
$this->assertParsed([$class], 'abstract class A { public abstract $a { set; } }');
}

#[Test]
Expand Down

0 comments on commit 6bfe8c0

Please sign in to comment.