Giter Site home page Giter Site logo

Comments (6)

timacdonald avatar timacdonald commented on August 25, 2024 1

It seems you aren't returning true from the closure.

from log-fake.

timacdonald avatar timacdonald commented on August 25, 2024 1

Hey, all the examples in the readme return a boolean, either true or false, e.g.,

Log::channel('slack')->assertLogged(
    fn (LogEntry $log) => $log->message === 'User logged in.'
);

from log-fake.

DaaN88 avatar DaaN88 commented on August 25, 2024 1

I understand, but in my first acquaintance with the package it was perceived as a simple assertion

from log-fake.

timacdonald avatar timacdonald commented on August 25, 2024

Can you please share the actual test snippet you are using in your tests?

from log-fake.

DaaN88 avatar DaaN88 commented on August 25, 2024

Yes, I can. In general, the test is simple - it shows that the rendering is correct (the rendering is processed at the Handler level in the Exceptions directory). Here is the code:

gist

PS. If it helps, here's a list of the packages I'm using

"require": {
        "php": "^8.2",
        "bschmitt/laravel-amqp": "^2.1",
        "darkaonline/l5-swagger": "^8.5",
        "guzzlehttp/guzzle": "^7.2",
        "intervention/image": "^2.7",
        "laravel/framework": "^10.16",
        "laravel/sanctum": "^3.2",
        "laravel/tinker": "^2.8",
        "maatwebsite/excel": "^3.1",
        "mews/purifier": "^3.4",
        "spatie/laravel-permission": "^5.10",
        "stancl/tenancy": "^3.7",
        "tymon/jwt-auth": "^2.0",
        "vladimir-yuldashev/laravel-queue-rabbitmq": "^13.3",
        "webmozart/assert": "^1.11"
    },
    "require-dev": {
        "dg/bypass-finals": "^1.4",
        "fakerphp/faker": "^1.9.1",
        "laravel/pint": "^1.0",
        "laravel/sail": "^1.18",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^7.0",
        "phpunit/phpunit": "^10.1",
        "psalm/plugin-laravel": "^2.8",
        "roave/security-advisories": "dev-latest",
        "spatie/laravel-ignition": "^2.0",
        "squizlabs/php_codesniffer": "^3.7",
        "timacdonald/log-fake": "^2.1"
    },

from log-fake.

DaaN88 avatar DaaN88 commented on August 25, 2024

Yes, you are right! :-) Thank's! (just add return true :-) )

But, in the readme there is no direct instruction to return true or I didn't see it.... And if there is nothing about true, maybe it should be added?

Something like this:

Log::channel(channel: 'channel_name')->assertLogged(callback: function (LogEntry $log) {
        // ... your assertions
    
        return true;
    }
);

and put "or not true returned" in the exception message.

from log-fake.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.