{"id":17844312,"url":"https://github.com/usox/hackmock","last_synced_at":"2025-04-02T15:10:45.228Z","repository":{"id":54916775,"uuid":"134048740","full_name":"usox/hackmock","owner":"usox","description":"Mock objects for hacklang","archived":false,"fork":false,"pushed_at":"2021-01-21T07:32:29.000Z","size":76,"stargazers_count":7,"open_issues_count":2,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T05:44:41.639Z","etag":null,"topics":["hack","hacklang","hhvm","mock","testing","tests"],"latest_commit_sha":null,"homepage":"","language":"Hack","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/usox.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-05-19T09:36:18.000Z","updated_at":"2025-02-06T13:41:57.000Z","dependencies_parsed_at":"2022-08-14T06:31:17.774Z","dependency_job_id":null,"html_url":"https://github.com/usox/hackmock","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usox%2Fhackmock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usox%2Fhackmock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usox%2Fhackmock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usox%2Fhackmock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usox","download_url":"https://codeload.github.com/usox/hackmock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246837683,"owners_count":20841903,"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":["hack","hacklang","hhvm","mock","testing","tests"],"created_at":"2024-10-27T21:28:40.617Z","updated_at":"2025-04-02T15:10:45.207Z","avatar_url":"https://github.com/usox.png","language":"Hack","readme":"[![Build Status](https://travis-ci.org/usox/hackmock.svg?branch=master)](https://travis-ci.org/usox/hackmock)\n\n# HackMock\n\nCreating mock objects for hacklang - yes, seriously.\n\n## Note\n\nDue to the use of `eval`, hackmock may stop working in future hhvm versions.\n\n## What works?\n- Strict mode\n- Creating mocks of interfaces and concrete classes\n- Defining basic method expectations (parameter validation, return value definition)\n\n## What does not work?\n- Everything else, especially rare and/or untested cases involving generics, etc.\n\n```php\nuse function Usox\\HackMock\\{mock, prospect};\n\nclass SomethingTest extends \\Usox\\HackMock\\HackMock {\n\n  public function testSomething() {\n    $my_fine_class = mock(SomeInterface::class);\n\n    prospect($my_fine_class, 'someMethodName')\n      -\u003eonce()\n      -\u003eandReturn('some-fine-value');\n\n    prospect($my_fine_class, 'someOtherMethodName')\n      -\u003eandThrow(new \\Exception('foobar'));\n  }\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusox%2Fhackmock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusox%2Fhackmock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusox%2Fhackmock/lists"}