Skip to content

Commit

Permalink
PHP 8.1 minimum version prep
Browse files Browse the repository at this point in the history
  • Loading branch information
rotimi committed Mar 14, 2024
1 parent f0b4cce commit dcf2fd3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
4 changes: 0 additions & 4 deletions tests/HelperFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,10 @@ public function testThat_object_has_property_WorksAsExpected() {
$this->assertFalse( object_has_property($obj_without_magic_methods, 'title2') ); // string property

$obj_real_and_dynamic_props_and_no_magic_methods = new TestValueObject2('John Doe', 47);
$obj_real_and_dynamic_props_and_no_magic_methods->dynamic_property1 = 'dynamic_property1';
$obj_real_and_dynamic_props_and_no_magic_methods->dynamic_property2 = 'dynamic_property2';
$this->assertTrue( object_has_property($obj_real_and_dynamic_props_and_no_magic_methods, 'name') ); // public property
$this->assertTrue( object_has_property($obj_real_and_dynamic_props_and_no_magic_methods, 'age') ); // public property
$this->assertTrue( object_has_property($obj_real_and_dynamic_props_and_no_magic_methods, 'protected_field') ); // protected property
$this->assertTrue( object_has_property($obj_real_and_dynamic_props_and_no_magic_methods, 'private_field') ); // private property
$this->assertTrue( object_has_property($obj_real_and_dynamic_props_and_no_magic_methods, 'dynamic_property1') ); // dynamically assigned property
$this->assertTrue( object_has_property($obj_real_and_dynamic_props_and_no_magic_methods, 'dynamic_property2') ); // dynamically assigned property
$this->assertFalse( object_has_property($obj_real_and_dynamic_props_and_no_magic_methods, 'non_existent_property') ); // non-existent property
}

Expand Down
6 changes: 1 addition & 5 deletions tests/UtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ public function testThatGetClosureFromCallableWorksAsExpected() {
$this->assertTrue(
Utils::getClosureFromCallable(\Descendant::class.'::who') instanceof \Closure
); // static method call string syntax

$this->assertTrue(
Utils::getClosureFromCallable([\Descendant::class, 'parent::who']) instanceof \Closure
); // parent class' static method call


$this->assertTrue(
Utils::getClosureFromCallable( (new \Descendant()) ) instanceof \Closure
); // instance of class that has __invoke()
Expand Down

0 comments on commit dcf2fd3

Please sign in to comment.