Skip to content

Comments

feat: add testing infrastructure and helpers#359

Open
Chemaclass wants to merge 9 commits intomainfrom
feat/testing-infrastructure
Open

feat: add testing infrastructure and helpers#359
Chemaclass wants to merge 9 commits intomainfrom
feat/testing-infrastructure

Conversation

@Chemaclass
Copy link
Member

TL;DR

Adds comprehensive testing infrastructure with GacelaTestCase and ContractTestCase base classes, along with helpers and examples for testing Gacela modules and facade contracts.

Summary

  • GacelaTestCase base class for testing Gacela modules
  • ContractTestCase for testing facade contract compliance
  • Testing helpers for common scenarios (mocking, assertions)
  • Module integration testing examples
  • Full documentation with best practices
  • Test coverage for test infrastructure

Key Features

GacelaTestCase:

use Gacela\Testing\GacelaTestCase;

class MyModuleTest extends GacelaTestCase
{
    public function test_module_integration(): void
    {
        $facade = $this->getFacade(MyFacade::class);
        
        $result = $facade->doSomething();
        
        $this->assertInstanceOf(Result::class, $result);
    }
}

ContractTestCase:

use Gacela\Testing\ContractTestCase;

class MyFacadeContractTest extends ContractTestCase
{
    public function test_facade_implements_contract(): void
    {
        $this->assertFacadeImplementsContract(
            MyFacade::class,
            MyFacadeInterface::class
        );
    }
}

Benefits

  • Consistent testing approach across modules
  • Reduced boilerplate in test code
  • Best practices for testing Gacela components
  • Easy to mock and stub dependencies
  • Contract testing for interface compliance
  • Integration testing support

Add comprehensive testing infrastructure with base test cases
and helpers for testing Gacela modules.

Key features:
- GacelaTestCase base class for module testing
- ContractTestCase for testing facade contracts
- Testing helpers for common test scenarios
- Module integration testing examples
- Mock and stub utilities for Gacela components
- Full documentation and examples

This provides a solid foundation for testing Gacela-based
applications with best practices baked in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant