From a040c9070de38ab36c7ec5b52bca1445d136c775 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 18 Aug 2026 19:00:49 -0400 Subject: [PATCH 1/2] update: Editorconfig --- .editorconfig | 8 +++---- .github/workflows/php84.yml | 46 ++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.editorconfig b/.editorconfig index 6250ff5..52d18dd 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,10 +8,10 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*.php] +[*.{ym,yml,yaml,js,json,scss}] indent_style = space -indent_size = 4 +indent_size = 2 -[*.{ym,yaml,js,json,scss}] +[*.{php,md}] indent_style = space -indent_size = 2 +indent_size = 4 diff --git a/.github/workflows/php84.yml b/.github/workflows/php84.yml index a7de1c7..34af196 100644 --- a/.github/workflows/php84.yml +++ b/.github/workflows/php84.yml @@ -1,34 +1,34 @@ name: PHP 8.4 on: - push: - branches: [main] - pull_request: - branches: [main] + push: + branches: [main] + pull_request: + branches: [main] jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4.2.2 - - name: Setup PHP Action - uses: shivammathur/setup-php@2.33.0 - with: - php-version: '8.4' + - name: Setup PHP Action + uses: shivammathur/setup-php@2.33.0 + with: + php-version: '8.4' - - name: Validate composer.json and composer.lock - run: composer validate + - name: Validate composer.json and composer.lock + run: composer validate - - name: Install dependencies - run: composer install --prefer-dist --no-progress + - name: Install dependencies + run: composer install --prefer-dist --no-progress - - name: Run style check - run: composer run style + - name: Run style check + run: composer run style - - name: Run static analyzer - run: composer run stan + - name: Run static analyzer + run: composer run stan - - name: Run tests - run: composer run test + - name: Run tests + run: composer run test From b2a964393c68408c5a50433f507cb0467bfdad3e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 18 Aug 2026 19:07:41 -0400 Subject: [PATCH 2/2] fix: PHPUnit update errors/warnings --- composer.json | 2 +- phpunit.xml | 37 +++++++++++++------------- tests/Components/CopyrightTest.php | 21 +++++---------- tests/Components/FaviconsTest.php | 21 +++++---------- tests/DocumentBaselineTest.php | 29 ++++++-------------- tests/ElementBaselineTest.php | 13 +++------ tests/ElementExtensionBaselineTest.php | 5 ++-- tests/Forms/SelectTest.php | 25 +++++------------ tests/PerformanceTest.php | 9 +++---- 9 files changed, 55 insertions(+), 107 deletions(-) diff --git a/composer.json b/composer.json index c9c930c..1abb13b 100644 --- a/composer.json +++ b/composer.json @@ -37,6 +37,6 @@ "production": ["@style", "@stan", "@test"], "style": "./vendor/bin/phpcs --standard=phpcs.xml -p ./src", "stan": "./vendor/bin/phpstan analyze", - "test": "./vendor/bin/phpunit" + "test": "./vendor/bin/phpunit --display-all-issues" } } diff --git a/phpunit.xml b/phpunit.xml index 4feb0b5..80b142f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,27 +2,26 @@ - - - - ./tests/ - - - - - - - - - ./src/ - - - vendor/ - - + + + + ./tests/ + + + + + + + + + ./src/ + + + vendor/ + + diff --git a/tests/Components/CopyrightTest.php b/tests/Components/CopyrightTest.php index 9031728..a2ec3f4 100644 --- a/tests/Components/CopyrightTest.php +++ b/tests/Components/CopyrightTest.php @@ -3,15 +3,14 @@ namespace Eightfold\HTMLBuilder\Tests\Components; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Eightfold\HTMLBuilder\Components\Copyright; class CopyrightTest extends TestCase { - /** - * @test - */ + #[Test] public function can_use_default(): void { $expected = '

© ' . date('Y') . ' Dr. Copyright

'; @@ -24,9 +23,7 @@ public function can_use_default(): void ); } - /** - * @test - */ + #[Test] public function can_use_bare_string(): void { $expected = '© ' . date('Y') . ' Dr. Copyright'; @@ -51,9 +48,7 @@ public function can_use_bare_string(): void ); } - /** - * @test - */ + #[Test] public function can_have_year_range(): void { $expected = '

© 2020–' . date('Y') . ' Dr. Copyright

'; @@ -66,9 +61,7 @@ public function can_have_year_range(): void ); } - /** - * @test - */ + #[Test] public function can_include_copyright(): void { $expected = '

Copyright ' . date('Y') . ' Dr. Copyright

'; @@ -92,9 +85,7 @@ public function can_include_copyright(): void ); } - /** - * @test - */ + #[Test] public function can_modify_reservations(): void { $expected = '

© ' . date('Y') . ' Dr. Copyright. All rights reserved.

'; diff --git a/tests/Components/FaviconsTest.php b/tests/Components/FaviconsTest.php index 6a48ffb..b265a0f 100644 --- a/tests/Components/FaviconsTest.php +++ b/tests/Components/FaviconsTest.php @@ -3,6 +3,7 @@ namespace Eightfold\HTMLBuilder\Tests\Components; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Eightfold\HTMLBuilder\Components\Favicons; @@ -11,9 +12,7 @@ class FaviconsTest extends TestCase { - /** - * @test - */ + #[Test] public function can_use_default(): void { $expected = file_get_contents(__DIR__ . '/favicons-default.xml'); @@ -26,9 +25,7 @@ public function can_use_default(): void ); } - /** - * @test - */ + #[Test] public function can_set_theme_color(): void { $expected = file_get_contents(__DIR__ . '/favicons-theme-color.xml'); @@ -43,9 +40,7 @@ public function can_set_theme_color(): void ); } - /** - * @test - */ + #[Test] public function can_use_subfolder(): void { $expected = file_get_contents(__DIR__ . '/favicons-subfolder.xml'); @@ -58,9 +53,7 @@ public function can_use_subfolder(): void ); } - /** - * @test - */ + #[Test] public function can_use_custom_app_name(): void { $expected = file_get_contents(__DIR__ . '/favicons-app-name.xml'); @@ -73,9 +66,7 @@ public function can_use_custom_app_name(): void ); } - /** - * @test - */ + #[Test] public function can_use_windows_metro_settings(): void { $expected = file_get_contents(__DIR__ . '/favicons-windows-metro.xml'); diff --git a/tests/DocumentBaselineTest.php b/tests/DocumentBaselineTest.php index 132a2a8..f893692 100644 --- a/tests/DocumentBaselineTest.php +++ b/tests/DocumentBaselineTest.php @@ -3,6 +3,7 @@ namespace Eightfold\HTMLBuilder\Tests; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Eightfold\HTMLBuilder\Document; @@ -13,9 +14,7 @@ class DocumentBaselineTest extends TestCase { - /** - * @test - */ + #[Test] public function can_add_properties_to_body_element(): void // phpcs:ignore { $expected = <<assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function can_have_body(): void // phpcs:ignore { $expected = <<assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function can_have_head(): void // phpcs:ignore { $expected = <<assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function can_change_lang_and_char_set(): void // phpcs:ignore { $expected = <<assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function has_baseline(): void // phpcs:ignore { $expected = <<assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function has_ordered_properties(): void // phpcs:ignore { $expected = <<assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function has_correct_selfclosing_string(): void // phpcs:ignore { $expected = <<assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function can_be_radio_buttons(): void // phpcs: ignore { $expected = <<assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function can_add_properties_to_wrapper(): void // phpcs: ignore { $expected = <<assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function can_preselect_option(): void // phpcs:ignore { $expected = <<assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function is_expected_base(): void // phpcs:ignore { $expected = <<assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function error_is_selected_value_always_string(): void // phpcs:ignore { $expected = <<assertLessThan(1.5, $ms); } - /** - * @test - */ + #[Test] public function document_is_small(): void // phpcs:ignore { $start = memory_get_usage();