Git Product home page Git Product logo

Comments (6)

samsonasik avatar samsonasik commented on July 29, 2024

In your tests setUp() function, you can exclude ErrorHeroModule from "modules" config, with assumption, your setUp() will be as follow:

    public function setUp()
    {
        // The module configuration should still be applicable for tests.
        // You can override configuration here with test case specific values,
        // such as sample view templates, path stacks, module_listener_options,
        // etc.
        $configOverrides = [];

        $appConfig = include __DIR__ . '/../../../../config/application.config.php';
        $appConfig['modules'] = \array_filter($appConfig['modules'], function($v, $k) {
            return $v !== 'ErrorHeroModule';
        }, ARRAY_FILTER_USE_BOTH);

        $this->setApplicationConfig(ArrayUtils::merge(
            $appConfig,
            $configOverrides
        ));

        parent::setUp();
    }

In above code, the $appConfig variable that passed to setApplicationConfig() already exclude the ErrorHeroModule that filtered via array_filter.

from errorheromodule.

anatolykhelmer avatar anatolykhelmer commented on July 29, 2024

Ok! Thanks for the fast reply! I'll use it for most of the tests!
But what if I want to actually test the integration with ErrorHeroModule?

from errorheromodule.

samsonasik avatar samsonasik commented on July 29, 2024

I think you can add \ob_get_flush(); in early in the setUp() method, eg:

    public function setUp()
    {
        \ob_get_flush();

        // The module configuration should still be applicable for tests.
        // You can override configuration here with test case specific values,
        // such as sample view templates, path stacks, module_listener_options,
        // etc.
        $configOverrides = [];

        $this->setApplicationConfig(ArrayUtils::merge(
            include __DIR__ . '/../../../../config/application.config.php',
            $configOverrides
        ));

        parent::setUp();
    }

from errorheromodule.

anatolykhelmer avatar anatolykhelmer commented on July 29, 2024

Thank you!

from errorheromodule.

samsonasik avatar samsonasik commented on July 29, 2024

@anatolykhelmer I've tagged new release 2.19.0 to ensure \ob_end_flush() executed while ob_get_level() > 0 before \ob_start() to flush and turn off existing active output buffering if any.

That's should handle that automatically.

from errorheromodule.

anatolykhelmer avatar anatolykhelmer commented on July 29, 2024

Thanks!

from errorheromodule.

Related Issues (19)

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.