Skip to content

Instantly share code, notes, and snippets.

@devhelp
devhelp / DbTestCase.php
Last active December 18, 2015 16:09
Test case for testing database queries, based on WebTestCase, doctrine tasks and using LoaderService.php (browse https://gist.github.com/devhelp for it)
<?php
namespace Devhelp\Bundle\TestBundle\Test;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Doctrine\DBAL\DriverManager;
use Doctrine\ORM\Tools\SchemaTool;
/**
* @package devhelp/test-bundle
@devhelp
devhelp / LoaderService.php
Last active December 18, 2015 15:49
LoaderService based on LoadDataFixturesDoctrineCommand. Basically all logic from the command extracted to reusable service class.
<?php
namespace Devhelp\Bundle\DataFixturesBundle\Service;
use Doctrine\ORM\EntityManager;
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
use Doctrine\Common\DataFixtures\Loader;
/**
* @author Paweł Barański <pawel.baranski1@gmail.com>