Skip to content

Add integration test suite for API contract validation#89

Closed
JoshSalway wants to merge 1 commit intolaravel:mainfrom
JoshSalway:feature/integration-tests
Closed

Add integration test suite for API contract validation#89
JoshSalway wants to merge 1 commit intolaravel:mainfrom
JoshSalway:feature/integration-tests

Conversation

@JoshSalway
Copy link

Summary

  • Adds tests/Integration/ApiContractTest.php with 9 read-only integration tests that hit the real Laravel Cloud API to validate DTO contracts
  • Tests cover: applications (list + get), environments, database clusters, caches, buckets, IP addresses, organization metadata, and regions
  • All tests use the integration group and skip gracefully when LARAVEL_CLOUD_API_TOKEN is not set
  • Integration tests are excluded from the default ./vendor/bin/pest run via <groups><exclude> in phpunit.xml.dist
  • No resources are ever created, updated, or deleted — strictly read-only

How to run

# Default test suite (integration tests excluded)
./vendor/bin/pest

# Integration tests only
LARAVEL_CLOUD_API_TOKEN=xxx ./vendor/bin/pest --group=integration

Closes #88

Test plan

  • Existing 31 tests still pass with ./vendor/bin/pest
  • Integration tests are excluded from default runs
  • Integration tests skip gracefully without LARAVEL_CLOUD_API_TOKEN
  • Integration tests pass against real API with valid token

🤖 Generated with Claude Code

Adds read-only integration tests that hit the real Laravel Cloud API to
catch contract drift between DTOs and actual API responses. Tests are
excluded from the default test run and skip gracefully when
LARAVEL_CLOUD_API_TOKEN is not set.

Closes laravel#88

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JoshSalway

This comment was marked as spam.

@JoshSalway JoshSalway closed this Mar 16, 2026
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.

feat: add optional integration test suite for API contract validation

1 participant