Skip to content

Comments

Refactor test data setup for relation-based fixtures and align PHPUnit docs#2752

Merged
spawnia merged 2 commits intomasterfrom
test-data-setup-compliance
Feb 11, 2026
Merged

Refactor test data setup for relation-based fixtures and align PHPUnit docs#2752
spawnia merged 2 commits intomasterfrom
test-data-setup-compliance

Conversation

@spawnia
Copy link
Collaborator

@spawnia spawnia commented Feb 11, 2026

  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

Changes

This PR aligns test fixture setup with CONTRIBUTING.md#test-data-setup:

  • Refactored targeted integration tests to prefer relations over direct FK writes
  • Replaced array-fill model setup in tests (for example ->make(['id' => 1])) with property assignment style
  • Removed literal ID coupling in refactored WhereConditionsDirectiveTest methods by using created model instances/keys
  • Updated docs/master/testing/phpunit.md examples to use /** @lang GraphQL */ plus nowdoc (<<<'GRAPHQL'), and property assignment style in setup examples

Touched files:

  • tests/Integration/Schema/Types/UnionTest.php
  • tests/Integration/Bind/BindDirectiveTest.php
  • tests/Integration/WhereConditions/WhereHasConditionsDirectiveTest.php
  • tests/Integration/Schema/Directives/AllDirectiveTest.php
  • tests/Integration/OrderBy/OrderByDirectiveDBTest.php
  • tests/Integration/WhereConditions/WhereConditionsDirectiveTest.php
  • CONTRIBUTING.md
  • docs/master/testing/phpunit.md
  • .ai/AGENTS.md

Validation run locally:

  • make fix
  • make test (passes; existing notices/skips/incomplete remain)
  • make stan

Breaking changes

None.

@spawnia spawnia merged commit fbd59b8 into master Feb 11, 2026
63 of 65 checks passed
@spawnia spawnia deleted the test-data-setup-compliance branch February 11, 2026 17:09
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