Skip to content

Instantly share code, notes, and snippets.

@alejobit
alejobit / DatabaseHandler.php
Last active March 12, 2024 15:33
Symfony Monolog database handler
<?php
namespace App\Monolog;
use App\Entity\Client;
use App\Entity\Log;
use App\Entity\User;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\ORMException;
use Monolog\Handler\AbstractProcessingHandler;
@a-ast
a-ast / FixtureAwareTestCase.php
Created May 2, 2016 12:23
Load doctrine fixtures before test
<?php
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
abstract class FixtureAwareTestCase extends KernelTestCase