Skip to content

Instantly share code, notes, and snippets.

View tPl0ch's full-sized avatar
💭
I may be slow to respond.

Thomas Ploch tPl0ch

💭
I may be slow to respond.
View GitHub Profile
@tPl0ch
tPl0ch / ODMFixtureTestCase.php
Created November 23, 2012 16:23
A Symfony2 TestCase base class that autoloads ODM Mongo Fixtures
<?php
namespace RC\FixtureAutoLoadBundle\Test;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\Common\DataFixtures\Executor\MongoDBExecutor;
use Doctrine\Common\DataFixtures\Purger\MongoDBPurger;
@tPl0ch
tPl0ch / Vagrantfile
Created October 30, 2012 15:06 — forked from jmather/Vagrantfile
Vagrant setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.provision OnHostProvisioner
end
class OnHostProvisioner < Vagrant::Provisioners::Base
def provision!
env[:vm].channel.execute("/home/vagrant/provision.sh")
end
@tPl0ch
tPl0ch / LoadArticleData.php
Created September 12, 2012 08:12 — forked from anonymous/gist:3705051
ODMFixtureWithReference
<?php
namespace Schuh\BlogBundle\DataFixtures\ODM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Schuh\BlogBundle\Document\Article;
use Schuh\BlogBundle\Document\Comment;
@tPl0ch
tPl0ch / FixtureTestCase.php
Created August 9, 2012 15:37
FixtureTestCase
<?php
namespace Reizwerk\TestSuiteBundle\Test;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\Common\DataFixtures\Executor\MongoDBExecutor;
use Doctrine\Common\DataFixtures\Purger\MongoDBPurger;
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/**
@tPl0ch
tPl0ch / MyServiceTest.php
Created July 22, 2012 14:23
Symfony2 ContainerAware TestCase Base class
<?php
/**
* Symfony2 ContainerAware TestCase Base class example implementation
*
* @author Thomas Ploch
* @copyright 2012 REIZWERK GmbH
* @license The MIT License (MIT)
*/
namespace Reizwerk\ContainerTestBundle\Tests;
@tPl0ch
tPl0ch / Configure.php
Created March 11, 2012 12:51
Configure Bootstrap ErrorHandler
<?php
/**
* Initializes configure and runs the bootstrap process.
* Bootstrapping includes the following steps:
*
* - Setup App array in Configure.
* - Include app/Config/core.php.
* - Configure core cache configurations.
* - Load App cache files.
* - Include app/Config/bootstrap.php.