{"id":25920215,"url":"https://github.com/vstelmakh/psr-test-logger","last_synced_at":"2025-10-10T00:34:52.912Z","repository":{"id":279079248,"uuid":"936328972","full_name":"vstelmakh/psr-test-logger","owner":"vstelmakh","description":"Easy to use PSR-3 compliant test-logger","archived":false,"fork":false,"pushed_at":"2025-10-04T19:24:42.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T21:23:50.702Z","etag":null,"topics":["log","logger","logging","php","psr-3","test"],"latest_commit_sha":null,"homepage":"","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/vstelmakh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2025-02-20T22:45:45.000Z","updated_at":"2025-10-04T19:24:44.000Z","dependencies_parsed_at":"2025-10-08T23:15:44.891Z","dependency_job_id":null,"html_url":"https://github.com/vstelmakh/psr-test-logger","commit_stats":null,"previous_names":["vstelmakh/psr-test-logger"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vstelmakh/psr-test-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vstelmakh%2Fpsr-test-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vstelmakh%2Fpsr-test-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vstelmakh%2Fpsr-test-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vstelmakh%2Fpsr-test-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vstelmakh","download_url":"https://codeload.github.com/vstelmakh/psr-test-logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vstelmakh%2Fpsr-test-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002359,"owners_count":26083357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"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":["log","logger","logging","php","psr-3","test"],"created_at":"2025-03-03T15:20:04.555Z","updated_at":"2025-10-10T00:34:52.906Z","avatar_url":"https://github.com/vstelmakh.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./resources/psr-test-logger-logo.svg\" width=\"301\" height=\"179\" alt=\"PSR Test Logger logo\"\u003e\n\n---\n\n[![build](https://github.com/vstelmakh/psr-test-logger/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/vstelmakh/psr-test-logger/actions/workflows/build.yml)\n[![Packagist version](https://img.shields.io/packagist/v/vstelmakh/psr-test-logger?color=orange)](https://packagist.org/packages/vstelmakh/psr-test-logger)\n\n# PSR Test Logger\nPSR Test Logger is a simple and easy-to-use [PSR-3](https://www.php-fig.org/psr/psr-3/) compliant logger designed specifically for testing.\nIt provides seamless integration with [PHPUnit](https://phpunit.de/), making logging assertions effortless.\nWith PSR Test Logger, you can efficiently verify log messages and context, ensuring your application logs expected events without unnecessary complexity.\n\nKey features:\n- **Fluent Interface** - Provides clean test assertions with intuitive IDE autocompletion.\n- **Predefined Assertions** - A rich set of built-in assertions to validate log messages and contexts.\n- **Automatic PHPUnit Integration** - Works seamlessly within PHPUnit test cases, with zero configuration.\n- **Extensible** - Easily customizable to fit your testing needs.\n\nIf you wonder why not to just mock the logger interface in your tests. The main 🏆 advantage of PSR Test Logger in \ncomparison to mocking logger - is simplicity of development and maintenance.\nFor more details and examples see the [Advantages of PSR Test Logger over Mock](./docs/advantages-over-mock.md).\n\n## Requirements\n| Requirement | Version |\n|-------------|---------|\n| PHP         | \u003e= 8.1  |\n| psr/log     | \u003e= 2.0  |\n\n\u003e [!NOTE]  \n\u003e PHPUnit is not required to use PSR Test Logger. It can be used completely standalone.\n\n## Installation\nInstall the latest version with [Composer](https://getcomposer.org/):\n\n```bash\ncomposer require --dev vstelmakh/psr-test-logger\n```\n\nRemember to require as `dev` dependency. Most likely, you don't need this in production.\n\n## Usage Example\n```php\n\u003c?php\n\nuse VStelmakh\\PsrTestLogger\\TestLogger;\nuse PHPUnit\\Framework\\TestCase;\n\nclass YourServiceTest extends TestCase\n{\n    public function testSomething(): void\n    {\n        $logger = new TestLogger();\n\n        $service = new YourService($logger);\n        $service-\u003edoSomething();\n\n        // Thanks to automatic PHPUnit integration,\n        // corresponding assertations can be performed as simple as:\n\n        $logger\n            -\u003eassert()\n            -\u003ehasLog()\n            -\u003ewithMessage('Execution complete.');\n\n        $logger\n            -\u003eassert()\n            -\u003ehasWarning()\n            -\u003ewithMessageContains('not found')\n            -\u003ewithContextContainsSameAs('id', 1);\n    }\n}\n```\n\n\u003e [!TIP]  \n\u003e For all the available methods see [Method Reference](./docs/method-reference.md) or check the source code, like [TestLogger](src/TestLogger.php) and [Matcher](src/Match/Matcher.php), it's well documented and easy to follow.\n\u003e Or simply use ⚡ autocompletion of your IDE!\n\n## Contributing and Support\nIf you find this useful, don't hesitate to ⭐ give it a star!  \nContributions are welcome. Please check out the [CONTRIBUTING](CONTRIBUTING.md) for guidelines.\n\n## Credits\n[Volodymyr Stelmakh](https://github.com/vstelmakh)  \nLicensed under the MIT License. See [LICENSE](LICENSE) for more information.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvstelmakh%2Fpsr-test-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvstelmakh%2Fpsr-test-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvstelmakh%2Fpsr-test-logger/lists"}