{"id":36268066,"url":"https://github.com/prodikl/mocktation","last_synced_at":"2026-01-11T08:42:47.785Z","repository":{"id":62530830,"uuid":"124592555","full_name":"prodikl/mocktation","owner":"prodikl","description":"PHP Mocking using annotations","archived":false,"fork":false,"pushed_at":"2018-12-13T05:32:33.000Z","size":20,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-27T16:25:18.043Z","etag":null,"topics":["annotations","mocking","php","php-mocking","phpunit","unit-testing"],"latest_commit_sha":null,"homepage":null,"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/prodikl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-09T20:59:22.000Z","updated_at":"2021-11-25T13:49:01.000Z","dependencies_parsed_at":"2022-11-02T14:31:30.798Z","dependency_job_id":null,"html_url":"https://github.com/prodikl/mocktation","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/prodikl/mocktation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prodikl%2Fmocktation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prodikl%2Fmocktation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prodikl%2Fmocktation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prodikl%2Fmocktation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prodikl","download_url":"https://codeload.github.com/prodikl/mocktation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prodikl%2Fmocktation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28298862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T08:21:30.231Z","status":"ssl_error","status_checked_at":"2026-01-11T08:21:26.882Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["annotations","mocking","php","php-mocking","phpunit","unit-testing"],"created_at":"2026-01-11T08:42:47.254Z","updated_at":"2026-01-11T08:42:47.779Z","avatar_url":"https://github.com/prodikl.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mocktation\nPHP Mocking using annotations\n\n[![Build Status](https://travis-ci.org/prodikl/mocktation.svg?branch=master)](https://travis-ci.org/prodikl/mocktation)\n\nMocktation lets you define return values of class methods when mocking, instead of having to define each return value in your tests.\n\nBy annotating using `@mockReturn   \"test\"`, the method will return `\"test\"` \nby default when calling the method after creating a mock using `$this-\u003ecreateMock(CLASSNAME)` in your tests.\n\nThis speeds up development since you can define default mock return values when writing the method, instead of retroactively deciding on mock values.\n\n1. Install Mocktation\n\n    ```bash\n    composer require-dev prodikl/mocktation\n    ```\n        \n2. Extend `Mocktation/Testcase` instead of PHPUnit TestCases\n\n    ```php\n    use Mocktation\\TestCase;\n    \n    class ExampleTest extends TestCase {\n        public function testGetNum(){\n            /** @var Example|MockObject $mock */\n            $mock = $this-\u003ecreateMock(Example::class);\n            $this-\u003eassertEquals(5, $mock-\u003egetNum(234));\n        }\n    } \n    ```\n    \n3. Use annotations to describe mocking in your methods\n\n    ```php\n    class Example {\n        /**\n         * Accepts an int $num and returns it\n         *\n         * @param $num      int     The num to return\n         * @return int      The example num\n         *\n         * @mockReturn      5\n         */\n        public function getNum($num){\n            return $num;\n        }\n    }\n    ```\n    \nHere's a list of Mocktation annotations\n\n- `@mockReturn [returnValue]` - Returns the [returnValue] when called\n- `@mockReturnArgument [argumentNumber]` - Returns the [argumentNumber] when called. [argumentNumber] starts from 0.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprodikl%2Fmocktation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprodikl%2Fmocktation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprodikl%2Fmocktation/lists"}