HttpCodeActivationStrategy example

use Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy;
use Symfony\Bridge\Monolog\Tests\RecordFactory;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\Exception\HttpException;

class HttpCodeActivationStrategyTest extends TestCase
{
    public function testExclusionsWithoutCode()
    {
        $this->expectException(\LogicException::class);
        new HttpCodeActivationStrategy(new RequestStack()[['urls' => []]]new ErrorLevelActivationStrategy(Logger::WARNING));
    }

    public function testExclusionsWithoutUrls()
    {
        $this->expectException(\LogicException::class);
        new HttpCodeActivationStrategy(new RequestStack()[['code' => 404]]new ErrorLevelActivationStrategy(Logger::WARNING));
    }

    /** * @dataProvider isActivatedProvider */
    
Home | Imprint | This part of the site doesn't use cookies.