{"id":15450343,"url":"https://github.com/formapro/fumocker","last_synced_at":"2025-04-19T22:58:17.602Z","repository":{"id":62506861,"uuid":"2430452","full_name":"formapro/Fumocker","owner":"formapro","description":"A php function mocker.","archived":false,"fork":false,"pushed_at":"2014-05-02T17:55:45.000Z","size":259,"stargazers_count":7,"open_issues_count":4,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-26T22:42:06.045Z","etag":null,"topics":[],"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/formapro.png","metadata":{"files":{"readme":"README.markdown","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":"2011-09-21T15:02:44.000Z","updated_at":"2015-06-11T19:57:32.000Z","dependencies_parsed_at":"2022-11-02T12:45:52.041Z","dependency_job_id":null,"html_url":"https://github.com/formapro/Fumocker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formapro%2FFumocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formapro%2FFumocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formapro%2FFumocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formapro%2FFumocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/formapro","download_url":"https://codeload.github.com/formapro/Fumocker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241610587,"owners_count":19990503,"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":[],"created_at":"2024-10-01T21:04:39.741Z","updated_at":"2025-03-03T04:30:49.341Z","avatar_url":"https://github.com/formapro.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fumocker [![Build Status](https://secure.travis-ci.org/formapro/Fumocker.png?branch=master)](http://travis-ci.org/formapro/Fumocker)\n\nAre you wonna mock mail function?\n\n```php\n\u003c?php\n\nclass FooTestCase extends \\PHPUnit_Framework_TestCase\n{\n    /**\n     * @var Fumocker\\Fumocker\n     */\n    protected $fumocker;\n\n    public function setUp()\n    {\n        $this-\u003efumocker = new \\Fumocker\\Fumocker;\n    }\n\n    public function tearDown()\n    {\n        $this-\u003efumocker-\u003ecleanup();\n    }\n\n    public function testMailNeverCalled()\n    {\n        /**\n         * @var $mock \\PHPUnit_Framework_MockObject_MockObject\n         */\n        $mock = $this-\u003efumocker-\u003egetMock('Namespace\\Where\\Tested\\Class\\Is', 'mail');\n        $mock\n            -\u003eexpects($this-\u003enever())\n            -\u003emethod('mail')\n        ;\n\n        //test your Namespace\\Where\\Tested\\Class\\Is\\Foo\n    }\n\n\n    public function testMailSendToAdminWithStatisticSubject()\n    {\n        $expectedEmailTo = 'admin@example.com';\n\n        /**\n         * @var $mock \\PHPUnit_Framework_MockObject_MockObject\n         */\n        $mock = $this-\u003efumocker-\u003egetMock('Namespace\\Where\\Tested\\Class\\Is', 'mail');\n        $mock\n            -\u003eexpects($this-\u003eonce())\n            -\u003emethod('mail')\n            -\u003ewith(\n                $this-\u003eequalTo($expectedEmailTo),\n                $this-\u003eequalTo('Statisitic of money earned by a week')\n            )\n        ;\n\n        //test your Namespace\\Where\\Tested\\Class\\Is\\Foo\n    }\n\n\n    public function testRealMailSend()\n    {\n        /**\n         * Dont do a mock and real function will be called\n         */\n    }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformapro%2Ffumocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformapro%2Ffumocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformapro%2Ffumocker/lists"}