Skip to content

Commit

Permalink
Remove runtime verification for PHP 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Mar 23, 2024
1 parent b243cd0 commit f1e4585
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/test/php/lang/reflection/unittest/ConstantsTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function no_comment() {
Assert::null($this->declare('{ const FIXTURE = "test"; }')->constant('FIXTURE')->comment());
}

#[Test, Runtime(php: '>=7.1')]
#[Test]
public function with_comment() {
Assert::equals('Test', $this->declare('{ /** Test */ const FIXTURE = "test"; }')->constant('FIXTURE')->comment());
}
Expand All @@ -55,19 +55,19 @@ public function named() {
Assert::equals($t->constant('FIXTURE'), $t->constants()->named('FIXTURE'));
}

#[Test, Runtime(php: '>=7.1')]
#[Test]
public function private_constant() {
$const= $this->declare('{ private const FIXTURE = "test"; }')->constant('FIXTURE');
Assert::equals([MODIFIER_PRIVATE, 'test'], [$const->modifiers()->bits(), $const->value()]);
}

#[Test, Runtime(php: '>=7.1')]
#[Test]
public function protected_constant() {
$const= $this->declare('{ protected const FIXTURE = "test"; }')->constant('FIXTURE');
Assert::equals([MODIFIER_PROTECTED, 'test'], [$const->modifiers()->bits(), $const->value()]);
}

#[Test, Runtime(php: '>=7.1')]
#[Test]
public function public_constant() {
$const= $this->declare('{ public const FIXTURE = "test"; }')->constant('FIXTURE');
Assert::equals([MODIFIER_PUBLIC, 'test'], [$const->modifiers()->bits(), $const->value()]);
Expand Down
4 changes: 2 additions & 2 deletions src/test/php/lang/reflection/unittest/MethodsTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function returns($decl, $present, $expected) {
Assert::equals([$present, $expected], [$returns->present(), $returns->type()]);
}

#[Test, Runtime(php: '>=7.1')]
#[Test]
public function returns_void() {
$returns= $this->declare('{ function fixture(): void { } }')->method('fixture')->returns();
Assert::equals(Type::$VOID, $returns->type());
Expand Down Expand Up @@ -122,7 +122,7 @@ public function returns_self() {
Assert::equals($type->class(), $type->method('fixture')->returns()->type());
}

#[Test, Runtime(php: '>=7.1')]
#[Test]
public function return_never_more_specific_than_void() {
$t= $this->declare('{ /** @return never */ function fixture(): void { exit(); } }');
Assert::equals(Type::$NEVER, $t->method('fixture')->returns()->type());
Expand Down
12 changes: 6 additions & 6 deletions src/test/php/lang/reflection/unittest/PropertiesTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function cannot_write_private_with_incorrect_context() {
$type->property('fixture')->set(null, 'Modified', typeof($this));
}

#[Test, Runtime(php: '>=7.4'), Expect(AccessingFailed::class)]
#[Test, Expect(AccessingFailed::class)]
public function type_mismatch() {
$type= $this->declare('{ private static array $fixture; }');
$type->property('fixture')->set(null, 1, $type);
Expand Down Expand Up @@ -145,7 +145,7 @@ public function type_from_apidoc($comment) {
Assert::equals(new Constraint(Primitive::$STRING, false), $type->property('fixture')->constraint());
}

#[Test, Runtime(php: '>=7.4')]
#[Test]
public function type_from_declaration() {
$type= $this->declare('{ public string $fixture; }');
Assert::equals(
Expand All @@ -154,7 +154,7 @@ public function type_from_declaration() {
);
}

#[Test, Runtime(php: '>=7.4')]
#[Test]
public function type_from_array_declaration() {
$type= $this->declare('{ public array $fixture; }');
Assert::equals(
Expand All @@ -163,7 +163,7 @@ public function type_from_array_declaration() {
);
}

#[Test, Runtime(php: '>=7.4')]
#[Test]
public function type_from_self_declaration() {
$type= $this->declare('{ public self $fixture; }');
Assert::equals(
Expand Down Expand Up @@ -223,7 +223,7 @@ public function string_representation_with_type_from_apidoc() {
);
}

#[Test, Runtime(php: '>=7.4')]
#[Test]
public function string_representation_with_type_declaration() {
$t= $this->declare('{ public string $fixture; }');
Assert::equals(
Expand All @@ -241,7 +241,7 @@ public function string_representation_with_union_type_declaration() {
);
}

#[Test, Runtime(php: '>=7.4')]
#[Test]
public function accessing_failed_target() {
$t= $this->declare('{ public static array $fixture; }');
try {
Expand Down

0 comments on commit f1e4585

Please sign in to comment.