{"repo":"timacdonald/log-fake","free":true,"listed":false,"github":"https://github.com/timacdonald/log-fake","clone":"git clone https://github.com/timacdonald/log-fake.git","description":"A drop in fake logger for testing with the Laravel framework.","language":"PHP","stars":423,"topics":["logging","laravel","testing","fake","php","hacktoberfest"],"license":"MIT","category":"dev-tools","readme_excerpt":"Log fake for Laravel A bunch of Laravel facades / services are able to be faked, such as the Dispatcher with Bus::fake() , to help with testing and assertions. This package gives you the ability to fake the logger in your app, and includes the ability to make assertions against channels, stacks, and a whole bunch more. Installation You can install using composer: Basic usage Channels If you are logging to a specific channel (i.e. not the default channel) in your app, you need to also prefix your assertions in the same manner. Stacks If you are logging to a stack in your app, like with channels, you will need to prefix your assertions. Note that the order of the stack does not matter. That's it really. Now let's dig into the available assertions to improve your experience testing your applications logging. Available assertions Remember that all assertions are relative to the channel or stack as shown above. - assertLogged() - assertLoggedTimes() - assertNotLogged() - assertNothingLogged() - assertWasForgotten() - assertWasForgottenTimes() - assertWasNotForgotten() - assertChannelIsCurrentlyForgotten() - assertCurrentContext() assertLogged() Assert that a log was created. Can be called on - [x] Facade base (default channel) - [x] Channels - [x] Stacks Example tests assertLoggedTimes() Assert that a log was created a specific number of times. Can be called on - [x] Facade base (default channel) - [x] Channels - [x] Stacks Example tests assertNotLogged() Assert that a log was nev","default_branch":null,"files":null,"tree":[],"storefront":"/r/timacdonald","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/timacdonald/log-fake/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}