diff --git a/CHANGELOG.md b/CHANGELOG.md index 5222d47..495ba0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ Change Log ========== -## 0.1.1 August 18, 2025 +## 0.2.0 August 18, 2025 - Bug #11: Refactor project structure and update dependencies (@terabytesoftw) +- Enh #12: Add `TestSupport` trait and corresponding test suite for inaccessible properties and methods (@terabytesoftw) ## 0.1.0 January 21, 2024 diff --git a/README.md b/README.md index 12e2718..7a2e317 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ - Invoke inaccessible methods to expand testing coverage. ✅ **Cross-Platform String Assertions** -- Eliminate false positives/negatives caused by Windows vs. Unix line-ending differences. +- Avoid false positives and negatives caused by Windows vs. Unix line ending differences. - Normalize line endings for consistent string comparisons across platforms. ✅ **File System Test Management** @@ -50,7 +50,7 @@ Install the extension. ```bash -composer require --dev --prefer-dist php-forge/support:^0.1 +composer require --dev --prefer-dist php-forge/support:^0.2 ``` #### Method 2: Manual installation @@ -60,7 +60,7 @@ Add to your `composer.json`. ```json { "require-dev": { - "php-forge/support": "^0.1" + "php-forge/support": "^0.2" } } ``` @@ -77,94 +77,133 @@ composer update ```php assertFileDoesNotExist( "{$dir}/test.txt", @@ -83,7 +86,7 @@ public function testReturnInaccessiblePropertyValueWhenPropertyIsPrivate(): void { self::assertSame( 'value', - Assert::inaccessibleProperty(new TestClass(), 'property'), + self::inaccessibleProperty(new TestClass(), 'property'), "Should return the value of the private property 'property' when accessed via reflection.", ); } @@ -95,7 +98,7 @@ public function testReturnValueWhenInvokingInaccessibleMethod(): void { $this->assertSame( 'value', - Assert::invokeMethod(new TestClass(), 'inaccessibleMethod'), + self::invokeMethod(new TestClass(), 'inaccessibleMethod'), "Should return 'value' when invoking the inaccessible method 'inaccessibleParentMethod' on 'TestClass' " . 'via reflection.', ); @@ -108,7 +111,7 @@ public function testReturnValueWhenInvokingInaccessibleParentMethod(): void { $this->assertSame( 'valueParent', - Assert::invokeParentMethod( + self::invokeParentMethod( new TestClass(), TestBaseClass::class, 'inaccessibleParentMethod', @@ -125,11 +128,11 @@ public function testSetInaccessibleParentProperty(): void { $object = new TestClass(); - Assert::setInaccessibleParentProperty($object, TestBaseClass::class, 'propertyParent', 'foo'); + self::setInaccessibleParentProperty($object, TestBaseClass::class, 'propertyParent', 'foo'); $this->assertSame( 'foo', - Assert::inaccessibleParentProperty($object, TestBaseClass::class, 'propertyParent'), + self::inaccessibleParentProperty($object, TestBaseClass::class, 'propertyParent'), "Should return 'foo' after setting the parent property 'propertyParent' via " . "'setInaccessibleParentProperty' method.", ); @@ -142,11 +145,11 @@ public function testSetInaccessiblePropertySetsValueCorrectly(): void { $object = new TestClass(); - Assert::setInaccessibleProperty($object, 'property', 'foo'); + self::setInaccessibleProperty($object, 'property', 'foo'); $this->assertSame( 'foo', - Assert::inaccessibleProperty($object, 'property'), + self::inaccessibleProperty($object, 'property'), "Should return 'foo' after setting the private property 'property' via 'setInaccessibleProperty' method.", ); } @@ -156,6 +159,6 @@ public function testThrowRuntimeExceptionWhenRemoveFilesFromDirectoryNonExisting $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Unable to open directory: non-existing-directory'); - Assert::removeFilesFromDirectory(__DIR__ . '/non-existing-directory'); + self::removeFilesFromDirectory(__DIR__ . '/non-existing-directory'); } }