{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/22523","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/22523/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/22523/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/22523/events","html_url":"https://github.com/laravel/framework/pull/22523","id":284325947,"number":22523,"title":"[5.5] Implementation the «fake» for «Log» facade","user":{"login":"Westwind-Galeaf","id":662467,"avatar_url":"https://avatars1.githubusercontent.com/u/662467?v=4","gravatar_id":"","url":"https://api.github.com/users/Westwind-Galeaf","html_url":"https://github.com/Westwind-Galeaf","followers_url":"https://api.github.com/users/Westwind-Galeaf/followers","following_url":"https://api.github.com/users/Westwind-Galeaf/following{/other_user}","gists_url":"https://api.github.com/users/Westwind-Galeaf/gists{/gist_id}","starred_url":"https://api.github.com/users/Westwind-Galeaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Westwind-Galeaf/subscriptions","organizations_url":"https://api.github.com/users/Westwind-Galeaf/orgs","repos_url":"https://api.github.com/users/Westwind-Galeaf/repos","events_url":"https://api.github.com/users/Westwind-Galeaf/events{/privacy}","received_events_url":"https://api.github.com/users/Westwind-Galeaf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-12-23T20:46:29Z","updated_at":"2017-12-25T12:38:39Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/22523","html_url":"https://github.com/laravel/framework/pull/22523","diff_url":"https://github.com/laravel/framework/pull/22523.diff","patch_url":"https://github.com/laravel/framework/pull/22523.patch"},"body":"This PR is an addition presenting the «fake» method of the «Log» facade for using in testing.\r\n\r\nMe and my colleagues have often a need to check the logging work. This PR allows to integrate a number of assert-methods for testing.\r\n\r\n```php\r\nLog::fake();\r\nLog::assertWritten(\"Hello world!\");\r\nLog::assertNotWritten(\"Another message!\");\r\nLog::assertWrittenTimes(\"Hello world!\", 1);\r\nLog::assertNothingWritten();\r\n```\r\n\r\nFor example: \r\n\r\n```php\r\nnamespace Tests\\Unit;\r\n\r\nuse Tests\\TestCase;\r\nuse Illuminate\\Support\\Facades\\Log;\r\n\r\nclass ExampleTest extends TestCase\r\n{\r\n    /**\r\n     * A basic test example.\r\n     *\r\n     * @return void\r\n     */\r\n    public function testBasicTest()\r\n    {\r\n        Log::fake();\r\n\r\n        Log::info('Hello world!');\r\n        Log::info('Hello world!');\r\n\r\n        Log::assertWritten('Hello world!');\r\n        Log::assertNotWritten('Another message!');\r\n        Log::assertWrittenTimes('Hello world!', 2);\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/353866846","html_url":"https://github.com/laravel/framework/pull/22523#issuecomment-353866846","issue_url":"https://api.github.com/repos/laravel/framework/issues/22523","id":353866846,"user":{"login":"Westwind-Galeaf","id":662467,"avatar_url":"https://avatars1.githubusercontent.com/u/662467?v=4","gravatar_id":"","url":"https://api.github.com/users/Westwind-Galeaf","html_url":"https://github.com/Westwind-Galeaf","followers_url":"https://api.github.com/users/Westwind-Galeaf/followers","following_url":"https://api.github.com/users/Westwind-Galeaf/following{/other_user}","gists_url":"https://api.github.com/users/Westwind-Galeaf/gists{/gist_id}","starred_url":"https://api.github.com/users/Westwind-Galeaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Westwind-Galeaf/subscriptions","organizations_url":"https://api.github.com/users/Westwind-Galeaf/orgs","repos_url":"https://api.github.com/users/Westwind-Galeaf/repos","events_url":"https://api.github.com/users/Westwind-Galeaf/events{/privacy}","received_events_url":"https://api.github.com/users/Westwind-Galeaf/received_events","type":"User","site_admin":false},"created_at":"2017-12-25T12:38:39Z","updated_at":"2017-12-25T12:38:39Z","author_association":"NONE","body":"Everything has the property of changing. It is right. My proposal relates to the current state of affairs. Perhaps in the future, this concept will also be used."}}
{"actor":{"display_login":"Westwind-Galeaf"}}