Skip to content

ContextHelper::is_in_type_test(): add tests#2721

Merged
jrfnl merged 3 commits into
developfrom
is-in-type-test-tests
Apr 27, 2026
Merged

ContextHelper::is_in_type_test(): add tests#2721
jrfnl merged 3 commits into
developfrom
is-in-type-test-tests

Conversation

@rodrigoprimo
Copy link
Copy Markdown
Contributor

@rodrigoprimo rodrigoprimo commented Apr 10, 2026

Description

In preparation for supporting PHPCS 4.0, this PR adds unit tests for the ContextHelper::is_in_type_test() method.

Suggested changelog entry

N/A

Related issues/external references

Related to: #2272

Copy link
Copy Markdown
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

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

Nicely done! Thanks.

@jrfnl jrfnl added this to the 3.4.0 milestone Apr 23, 2026
Copy link
Copy Markdown
Member

@GaryJones GaryJones left a comment

Choose a reason for hiding this comment

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

Approved, with one suggestion.

Comment thread WordPress/Tests/Helpers/ContextHelper/IsInTypeTestUnitTest.inc Outdated
@rodrigoprimo
Copy link
Copy Markdown
Contributor Author

I added a new commit with a negative bare variable test as suggested in #2725 (review) for consistency.

@jrfnl jrfnl force-pushed the is-in-type-test-tests branch from 33999b2 to 5447a46 Compare April 27, 2026 13:08
@jrfnl
Copy link
Copy Markdown
Member

jrfnl commented Apr 27, 2026

I've rebased this PR without changes to get passed the imaginary merge conflict.

@jrfnl jrfnl merged commit adaf62d into develop Apr 27, 2026
42 checks passed
@jrfnl jrfnl deleted the is-in-type-test-tests branch April 27, 2026 13:11
lesterchan added a commit to lesterchan/WordPress-Coding-Standards that referenced this pull request May 4, 2026
* upstream/develop: (223 commits)
  ContextHelper::is_in_type_test(): add tests (WordPress#2721)
  WPDBTrait::is_wpdb_method_call(): improve docblock description (WordPress#2719)
  ContextHelper::is_in_array_comparison(): add basic tests (WordPress#2726)
  ContextHelper::is_in_isset_or_empty(): add basic tests (WordPress#2725)
  WP/I18n: add tests for namespaced names
  WP/GetMetaSingle: add tests for namespaced names
  WP/DeprecatedParameterValues: add tests for namespaced names
  WP/DeprecatedParameterValues: move syntax error test to its own file
  WP/DeprecatedParameterValues: rename test case file
  WP/DeprecatedParameters: add tests for namespaced names
  FormattingFunctionsHelper::is_formatting_function(): add tests (WordPress#2713)
  UnslashingFunctionsHelper::is_unslashing_function(): add tests (WordPress#2715)
  GH Actions: Bump crate-ci/typos from 1.44.0 to 1.45.0 in the action-runners group (WordPress#2717)
  GH Actions: Bump codecov/codecov-action from 5.5.3 to 6.0.0
  GH Actions: Bump ramsey/composer-install from 3.1.1 to 4.0.0
  GH Actions: Bump the action-runners group with 2 updates
  Security/ValidatedSanitizedInput: add tests for namespaced names
  Apply suggestion from PR review
  WP/EnqueuedResourceParameters: add tests for namespaced names (WordPress#2675)
  GH Actions: Bump crate-ci/typos in the action-runners group
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants