PhlytyTest\AppTest::testCallingHaltTriggersHaltEvent PHP Method

testCallingHaltTriggersHaltEvent() public method

    public function testCallingHaltTriggersHaltEvent()
    {
        $foo = $this->app->get('/foo', function ($app) {
            $app->halt(418, "Calmez vous");
        });
        $test = (object) ['status' => false];
        $this->app->events()->attach('halt', function ($app) use($test) {
            $test->status = true;
        });
        $request = $this->app->request();
        $request->setMethod('GET')->setUri('/foo');
        $this->app->run();
        $this->assertTrue($test->status);
    }
AppTest