From 1158b60175e9929b557451ab8d8c29285a3a1e13 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 25 Mar 2026 16:28:09 +0000 Subject: [PATCH 1/2] test: ensure `empty()` behaves as expected with `value` property closes #471 --- test/phpunit/ElementTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/phpunit/ElementTest.php b/test/phpunit/ElementTest.php index e576d1a4..9c1fe189 100644 --- a/test/phpunit/ElementTest.php +++ b/test/phpunit/ElementTest.php @@ -650,4 +650,23 @@ public function testConstruct_copyrightTrademark():void { self::assertStringContainsString($copyright, $h1->innerHTML); self::assertStringContainsString($trademark, $h1->innerHTML); } + + public function testValue_empty():void { + $document = new HTMLDocument(""); + $sut = $document->querySelector("input[name='test']"); + self::assertEmpty($sut->value); + } + + public function testValue_notEmptyFromHTML():void { + $document = new HTMLDocument(""); + $sut = $document->querySelector("input[name='test']"); + self::assertNotEmpty($sut->value); + } + + public function testValue_notEmptyFromProperty():void { + $document = new HTMLDocument(); + $sut = $document->createElement("input"); + $sut->value = "abcdef"; + self::assertNotEmpty($sut->value); + } } From d7ed1dd65a9946f0bac6930a8de2295ac1aa5da1 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 25 Mar 2026 16:30:30 +0000 Subject: [PATCH 2/2] ci: retain artifacts for 1 day --- .github/workflows/ci.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87e36225..d4193ef0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,7 @@ jobs: with: name: build-artifact-${{ matrix.php }} path: /tmp/github-actions + retention-days: 1 phpunit: runs-on: ubuntu-latest @@ -161,21 +162,3 @@ jobs: php_version: ${{ matrix.php }} path: src/ standard: phpcs.xml - - remove_old_artifacts: - runs-on: ubuntu-latest - - permissions: - actions: write - - steps: - - name: Remove old artifacts for prior workflow runs on this repository - env: - GH_TOKEN: ${{ github.token }} - run: | - gh api "/repos/${{ github.repository }}/actions/artifacts" | jq ".artifacts[] | select(.name | startswith(\"build-artifact\")) | .id" > artifact-id-list.txt - while read id - do - echo -n "Deleting artifact ID $id ... " - gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done" - done