From 3ab06445b45653415c372ecb300dcf73c77b5d16 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 23 Jun 2024 02:13:54 +0700 Subject: [PATCH] refactor: using phpunit 10 assertObjectHasNotProperty() and assertObjectHasProperty() --- tests/system/Config/BaseConfigTest.php | 2 +- tests/system/Test/FabricatorTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system/Config/BaseConfigTest.php b/tests/system/Config/BaseConfigTest.php index c8e27dce75ef..2217120f1ea4 100644 --- a/tests/system/Config/BaseConfigTest.php +++ b/tests/system/Config/BaseConfigTest.php @@ -131,7 +131,7 @@ public function testEnvironmentOverrides(): void // override config with shortPrefix ENV var $this->assertSame('hubbahubba', $config->delta); // incorrect env name should not inject property - $this->assertFalse(property_exists($config, 'notthere')); + $this->assertObjectNotHasProperty('notthere', $config); // empty ENV var should not affect config setting $this->assertSame('pineapple', $config->fruit); // non-empty ENV var should overrideconfig setting diff --git a/tests/system/Test/FabricatorTest.php b/tests/system/Test/FabricatorTest.php index 46e7f7d95cfe..c8ae1a7a1db6 100644 --- a/tests/system/Test/FabricatorTest.php +++ b/tests/system/Test/FabricatorTest.php @@ -413,7 +413,7 @@ public function testCreateMockSetsDatabaseFields(): void $this->assertIsInt($result->created_at); $this->assertIsInt($result->updated_at); - $this->assertTrue(property_exists($result, 'deleted_at')); + $this->assertObjectHasProperty('deleted_at', $result); $this->assertNull($result->deleted_at); }