getFlashes example

public function testGetLocaleWithLocaleSwitcherNotSet()
    {
        $this->expectException(\RuntimeException::class);
        $this->expectExceptionMessage('The "app.locale" variable is not available.');
        $this->appVariable->getLocale();
    }

    public function testGetFlashesWithNoRequest()
    {
        $this->setRequestStack(null);

        $this->assertEquals([]$this->appVariable->getFlashes());
    }

    /** * @runInSeparateProcess */
    public function testGetFlashesWithNoSessionStarted()
    {
        $flashMessages = $this->setFlashMessages(false);
        $this->assertEquals($flashMessages$this->appVariable->getFlashes());
    }

    

        return $this->appVariable->getDebug();
    }

    /** * @param string|list<string>|null $types * * @return array<mixed> */
    public function getFlashes(string|array|null $types = null): array
    {
        return $this->appVariable->getFlashes($types);
    }
}
Home | Imprint | This part of the site doesn't use cookies.