-
Notifications
You must be signed in to change notification settings - Fork 0
Dev #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Dev #13
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8b31f11
feat: add SectionPattern helper for frontend pattern rendering
dannorthern e722a40
fix: update pattern config key.
dannorthern 92383a0
feat: add button appearance variants and improve button structure
dannorthern c8052e7
feat: add pattern alignment support to SectionPattern helper
dannorthern 4368554
test: add test infrastructure
dannorthern dd61108
feat: add CI workflow for automated testing
dannorthern 959ff07
fix: remove version from composer.json to prevent merge conflicts
dannorthern 6070997
fix: skip lock file check in composer validation
dannorthern 88f6a3c
Merge branch 'main' into dev
dannorthern File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php-version: ['8.1', '8.2', '8.3', '8.4'] | ||
|
|
||
| name: PHP ${{ matrix.php-version }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php-version }} | ||
| coverage: xdebug | ||
| tools: composer:v2 | ||
|
|
||
| - name: Get composer cache directory | ||
| id: composer-cache | ||
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Cache dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.composer-cache.outputs.dir }} | ||
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: ${{ runner.os }}-composer- | ||
|
|
||
| - name: Validate composer.json | ||
| run: composer validate --strict --no-check-lock | ||
|
|
||
| - name: Install dependencies | ||
| run: composer install --prefer-dist --no-progress --no-interaction | ||
|
|
||
| - name: Security check for vulnerabilities | ||
| run: composer audit --no-dev | ||
|
|
||
| - name: Run PHPUnit tests | ||
| run: composer test | ||
|
|
||
| - name: Run PHPUnit with coverage | ||
| if: matrix.php-version == '8.2' | ||
| run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| if: matrix.php-version == '8.2' | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| file: ./coverage.xml | ||
| flags: unittests | ||
| fail_ci_if_error: false | ||
|
|
||
| - name: Run PHPCS coding standards check | ||
| if: matrix.php-version == '8.2' | ||
| run: composer lint | ||
|
|
||
| - name: Check PHP compatibility | ||
| if: matrix.php-version == '8.2' | ||
| run: composer phpcompat | ||
|
|
||
| test-status: | ||
| name: Test Status | ||
| runs-on: ubuntu-latest | ||
| needs: test | ||
| if: always() | ||
|
|
||
| steps: | ||
| - name: Check test results | ||
| run: | | ||
| if [ "${{ needs.test.result }}" == "success" ]; then | ||
| echo "✅ All tests passed!" | ||
| exit 0 | ||
| else | ||
| echo "❌ Tests failed!" | ||
| exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"version":1,"defects":{"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_component_is_singleton":4,"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_init_registers_components":4,"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_component_classes_registered":4,"BuiltNorth\\WPUtility\\Tests\\Unit\\HelperTest::test_helper_is_singleton":4,"BuiltNorth\\WPUtility\\Tests\\Unit\\HelperTest::test_init_registers_helpers":4,"BuiltNorth\\WPUtility\\Tests\\Unit\\HelperTest::test_helper_classes_registered":4,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_utility_is_singleton":4,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_init_registers_utilities":4,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_utility_classes_registered":4},"times":{"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_component_is_singleton":0.001,"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_init_registers_components":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_component_classes_registered":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_accessible_card_component_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_breadcrumbs_component_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_button_component_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_image_component_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_pagination_component_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_post_card_component_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\ComponentTest::test_post_feed_component_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\HelperTest::test_helper_is_singleton":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\HelperTest::test_init_registers_helpers":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\HelperTest::test_helper_classes_registered":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\HelperTest::test_escape_svg_helper_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\HelperTest::test_foreground_image_helper_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\HelperTest::test_section_background_helper_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\HelperTest::test_section_pattern_helper_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\Utilities\\ReadingTimeTest::test_calculate_reading_time_short_text":0.003,"BuiltNorth\\WPUtility\\Tests\\Unit\\Utilities\\ReadingTimeTest::test_calculate_reading_time_medium_text":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\Utilities\\ReadingTimeTest::test_calculate_reading_time_long_text":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\Utilities\\ReadingTimeTest::test_calculate_reading_time_with_html":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\Utilities\\ReadingTimeTest::test_calculate_reading_time_empty_content":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\Utilities\\ReadingTimeTest::test_calculate_reading_time_special_characters":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_utility_is_singleton":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_init_registers_utilities":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_utility_classes_registered":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_archive_url_utility_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_country_list_utility_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_get_terms_utility_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_get_title_utility_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_image_setup_utility_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_lazy_load_first_block_utility_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_reading_time_utility_exists":0,"BuiltNorth\\WPUtility\\Tests\\Unit\\UtilityTest::test_state_list_utility_exists":0}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,51 @@ | ||
| { | ||
| "name": "builtnorth/wp-utility", | ||
| "description": "Utility functions and helpers for WordPress development", | ||
| "type": "library", | ||
| "version": "2.1.0", | ||
| "license": "GPL-2.0-or-later", | ||
| "authors": [ | ||
| { | ||
| "name": "BuiltNorth", | ||
| "email": "hello@builtnorth.co" | ||
| } | ||
| ], | ||
| "require": { | ||
| "php": ">=8.1" | ||
| }, | ||
| "autoload": { | ||
| "psr-4": { | ||
| "BuiltNorth\\WPUtility\\": "inc/" | ||
| } | ||
| }, | ||
| "autoload-dev": { | ||
| "psr-4": { | ||
| "BuiltNorth\\WPUtility\\Tests\\": "tests/" | ||
| } | ||
| }, | ||
| "require-dev": { | ||
| "phpunit/phpunit": "^9.0", | ||
| "squizlabs/php_codesniffer": "^3.0", | ||
| "phpcompatibility/php-compatibility": "^9.0" | ||
| }, | ||
| "config": { | ||
| "optimize-autoloader": true, | ||
| "sort-packages": true | ||
| }, | ||
| "minimum-stability": "stable", | ||
| "prefer-stable": true | ||
| "name": "builtnorth/wp-utility", | ||
| "description": "Utility functions and helpers for WordPress development", | ||
| "type": "library", | ||
| "license": "GPL-2.0-or-later", | ||
| "authors": [ | ||
| { | ||
| "name": "BuiltNorth", | ||
| "email": "hello@builtnorth.co" | ||
| } | ||
| ], | ||
| "require": { | ||
| "php": ">=8.1" | ||
| }, | ||
| "autoload": { | ||
| "psr-4": { | ||
| "BuiltNorth\\WPUtility\\": "inc/" | ||
| } | ||
| }, | ||
| "autoload-dev": { | ||
| "psr-4": { | ||
| "BuiltNorth\\WPUtility\\Tests\\": "tests/" | ||
| } | ||
| }, | ||
| "require-dev": { | ||
| "phpunit/phpunit": "^9.0", | ||
| "10up/wp_mock": "^1.0", | ||
| "mockery/mockery": "^1.5", | ||
| "builtnorth/coding-standards": "*" | ||
| }, | ||
| "scripts": { | ||
| "test": "phpunit", | ||
| "test:unit": "phpunit --testsuite Unit", | ||
| "test:coverage": "phpunit --coverage-html coverage", | ||
| "lint": "phpcs", | ||
| "lint:fix": "phpcbf", | ||
| "phpcs": "phpcs", | ||
| "phpcs:summary": "phpcs --report=summary", | ||
| "phpcbf": "phpcbf", | ||
| "phpcompat": "phpcs -p . --standard=PHPCompatibility --runtime-set testVersion 8.1-" | ||
| }, | ||
| "config": { | ||
| "optimize-autoloader": true, | ||
| "sort-packages": true, | ||
| "allow-plugins": { | ||
| "dealerdirect/phpcodesniffer-composer-installer": true | ||
| } | ||
| }, | ||
| "minimum-stability": "dev", | ||
| "prefer-stable": true | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting minimum-stability to 'dev' can introduce unstable dependencies into the project. Consider using 'stable' instead, or if dev packages are needed, specify them individually with stability flags (e.g., 'package/name:dev-main').