Skip to content

🧪 Add test for hyphens in urls plugin#224

Merged
projectedanx merged 1 commit into
masterfrom
jules-141920729589512018-ee1db5a2
Jun 6, 2026
Merged

🧪 Add test for hyphens in urls plugin#224
projectedanx merged 1 commit into
masterfrom
jules-141920729589512018-ee1db5a2

Conversation

@projectedanx

Copy link
Copy Markdown
Owner

🎯 What: The ozh_hyphen_in_charset function in the hyphens-in-urls plugin was untested.
📊 Coverage: The happy path and edge cases (like empty strings) for the target function are now covered.
Result: The test suite now correctly asserts that a hyphen - is appended to the input.


PR created automatically by Jules for task 141920729589512018 started by @projectedanx

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new PHPUnit test class, HyphensInUrlsPluginTest, to verify the behavior of the hyphens-in-urls plugin. The feedback recommends adding a tearDown method to unregister the global filter added by the plugin, ensuring proper test isolation and preventing potential test pollution in subsequent test runs.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +6 to +9
protected function setUp(): void {
parent::setUp();
require_once dirname( dirname( dirname( __DIR__ ) ) ) . '/user/plugins/hyphens-in-urls/plugin.php';
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Loading the plugin file via require_once registers the ozh_hyphen_in_charset filter globally. Since PHPUnit runs tests in the same process, this filter will persist and affect subsequent tests, leading to potential test pollution and unexpected failures in other test suites.

To ensure proper test isolation, we should clean up and remove the registered filter in the tearDown() method.

    protected function setUp(): void {
        parent::setUp();
        require_once dirname( dirname( dirname( __DIR__ ) ) ) . '/user/plugins/hyphens-in-urls/plugin.php';
    }

    protected function tearDown(): void {
        yourls_remove_filter( 'get_shorturl_charset', 'ozh_hyphen_in_charset' );
        parent::tearDown();
    }

@projectedanx projectedanx merged commit 0ec6e5d into master Jun 6, 2026
15 of 16 checks passed
@projectedanx projectedanx deleted the jules-141920729589512018-ee1db5a2 branch June 6, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant