{"id":34939010,"url":"https://github.com/phpnomad/tests","last_synced_at":"2026-05-23T02:32:00.668Z","repository":{"id":205792579,"uuid":"700795179","full_name":"phpnomad/tests","owner":"phpnomad","description":"Shared testing utilities and base classes for PHPNomad packages","archived":false,"fork":false,"pushed_at":"2026-04-10T02:14:34.000Z","size":71,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-10T02:36:24.726Z","etag":null,"topics":["framework","php","phpnomad","phpunit","platform-agnostic","testing"],"latest_commit_sha":null,"homepage":"https://phpnomad.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phpnomad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-05T10:03:01.000Z","updated_at":"2026-04-10T02:14:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"ef0f2803-7fb5-4c44-a706-0cf38bec5e36","html_url":"https://github.com/phpnomad/tests","commit_stats":null,"previous_names":["phpnomad/tests"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/phpnomad/tests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Ftests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Ftests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Ftests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Ftests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpnomad","download_url":"https://codeload.github.com/phpnomad/tests/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Ftests/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33380486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T01:21:08.577Z","status":"online","status_checked_at":"2026-05-23T02:00:05.530Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","php","phpnomad","phpunit","platform-agnostic","testing"],"created_at":"2025-12-26T18:49:40.052Z","updated_at":"2026-05-23T02:32:00.661Z","avatar_url":"https://github.com/phpnomad.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpnomad/tests\n\n[![Latest Version](https://img.shields.io/packagist/v/phpnomad/tests.svg)](https://packagist.org/packages/phpnomad/tests)\n[![Total Downloads](https://img.shields.io/packagist/dt/phpnomad/tests.svg)](https://packagist.org/packages/phpnomad/tests)\n[![PHP Version](https://img.shields.io/packagist/php-v/phpnomad/tests.svg)](https://packagist.org/packages/phpnomad/tests)\n[![License](https://img.shields.io/packagist/l/phpnomad/tests.svg)](https://packagist.org/packages/phpnomad/tests)\n\n`phpnomad/tests` is the shared PHPUnit base that PHPNomad packages use for their own unit tests. It provides a `TestCase` wired up with Mockery-PHPUnit integration and two reflection traits for reaching into protected or private state. If you're writing application code against PHPNomad, you don't need this package. If you're contributing to a PHPNomad package, its `tests/` directory almost certainly already depends on it.\n\n## Installation\n\n```bash\ncomposer require --dev phpnomad/tests\n```\n\nPull it in as a dev dependency only. It isn't meant for production code paths.\n\n## What's included\n\n- `PHPNomad\\Tests\\TestCase` extends `PHPUnit\\Framework\\TestCase` and mixes in `MockeryPHPUnitIntegration`, so Mockery expectations are verified and containers cleaned up automatically between tests.\n- `PHPNomad\\Tests\\Traits\\WithInaccessibleMethods` provides `callInaccessibleMethod()` for invoking protected or private methods through reflection.\n- `PHPNomad\\Tests\\Traits\\WithInaccessibleProperties` provides `getProtectedProperty()`, `getProtectedPropertyValue()`, and `setProtectedProperty()` for reading and writing protected or private properties through reflection.\n\n## Usage pattern\n\nEach PHPNomad package defines its own package-local `TestCase` that extends the shared one. That gives the package its own namespace root under `Tests/` while inheriting the PHPUnit and Mockery plumbing.\n\n```php\n\u003c?php\n\nnamespace MyPackage\\Tests;\n\nuse PHPNomad\\Tests\\TestCase as PHPNomadTestCase;\n\nclass TestCase extends PHPNomadTestCase\n{\n}\n```\n\nConcrete unit tests then extend the package-local `TestCase` and mix in whichever traits they need.\n\n```php\n\u003c?php\n\nnamespace MyPackage\\Tests\\Unit;\n\nuse MyPackage\\Services\\WidgetBuilder;\nuse MyPackage\\Tests\\TestCase;\nuse PHPNomad\\Tests\\Traits\\WithInaccessibleMethods;\n\nclass WidgetBuilderTest extends TestCase\n{\n    use WithInaccessibleMethods;\n\n    public function testNormalizeHandlesEmptyInput(): void\n    {\n        $builder = new WidgetBuilder();\n\n        $result = $this-\u003ecallInaccessibleMethod($builder, 'normalize', '');\n\n        $this-\u003eassertSame('', $result);\n    }\n}\n```\n\n## Documentation\n\nFramework-wide documentation lives at [phpnomad.com](https://phpnomad.com).\n\n## License\n\nMIT. See [LICENSE.txt](LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpnomad%2Ftests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpnomad%2Ftests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpnomad%2Ftests/lists"}