{"id":18322132,"url":"https://github.com/maks3w/phpunitmethodstrait","last_synced_at":"2025-04-05T22:32:36.102Z","repository":{"id":33752011,"uuid":"37407166","full_name":"Maks3w/PhpUnitMethodsTrait","owner":"Maks3w","description":"Provide PHPUnit method signatures as traits for IDE autocomplete","archived":false,"fork":false,"pushed_at":"2023-04-03T05:00:15.000Z","size":41,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T13:23:03.888Z","etag":null,"topics":["hacktoberfest","phpunit","testcase","testing","trait"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Maks3w.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}},"created_at":"2015-06-14T09:46:59.000Z","updated_at":"2021-10-15T10:27:28.000Z","dependencies_parsed_at":"2023-02-16T03:46:05.758Z","dependency_job_id":"c9e27394-b659-4cc9-a379-7860f8966030","html_url":"https://github.com/Maks3w/PhpUnitMethodsTrait","commit_stats":{"total_commits":27,"total_committers":3,"mean_commits":9.0,"dds":"0.14814814814814814","last_synced_commit":"1d3cced706098bc135f2e54e579ff37de853edb6"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maks3w%2FPhpUnitMethodsTrait","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maks3w%2FPhpUnitMethodsTrait/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maks3w%2FPhpUnitMethodsTrait/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maks3w%2FPhpUnitMethodsTrait/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Maks3w","download_url":"https://codeload.github.com/Maks3w/PhpUnitMethodsTrait/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411249,"owners_count":20934650,"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","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":["hacktoberfest","phpunit","testcase","testing","trait"],"created_at":"2024-11-05T18:23:17.039Z","updated_at":"2025-04-05T22:32:35.851Z","avatar_url":"https://github.com/Maks3w.png","language":"PHP","readme":"# PHPUnit methods trait\n\nProvide a PHP Trait with methods present in PHPUnit Test Framework and expected to be implemented by TestCase.\n\nThis is useful when traits are used for test reuse, and it's necessary to access to PHPUnit\\Framework\\TestCase\nmethods from the trait.\n\n## Installing via Composer\n\nYou can use [Composer](https://getcomposer.org) .\n\n```bash\ncomposer require maks3w/phpunit-methods-trait\n```\n\n## Usage\n\nExample of use in a trait\n\n```php\n\nuse PHPUnit\\Framework\\Assert;\nuse PHPUnit\\Framework\\TestCase;\n\ntrait FooTrait {\n  use \\Maks3w\\PhpUnitMethodsTrait\\Framework\\TestCaseTrait;\n\n  public function testFoo() {\n    $mockFoo = $this-\u003egetMock('Foo');\n    $mockFoo-\u003eexpects(TestCase::any())\n      -\u003emethod('getFoo')\n      -\u003ewillReturn(true)\n    ;\n\n    Assert::assertTrue($mockFoo-\u003egetFoo());\n  }\n}\n```\n\n## FAQ\n\n\u003cdl\u003e\n  \u003cdt\u003eQ: Assertion methods are not recognized. Why?\u003c/dt\u003e\n  \u003cdd\u003e\n    A: Assertion methods like `assertTrue` are static methods present in `PHPUnit\\Framework\\Assert` just access them\n       using static method call `PHPUnit\\Framework\\Assert::assertTrue(...)`\n  \u003c/dd\u003e\n\u003c/dl\u003e\n\n## License\n\n  Code licensed under BSD 2 clauses terms \u0026 conditions.\n\n  See [LICENSE.txt](LICENSE.txt) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaks3w%2Fphpunitmethodstrait","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaks3w%2Fphpunitmethodstrait","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaks3w%2Fphpunitmethodstrait/lists"}