public static function setUpBeforeClass() { $client = static::createClient(); $manager = $client->getContainer()->get('h4cc_alice_fixtures.manager'); static::$fixtures = $manager->loadFiles(static::$fixtures); $manager->persist(static::$fixtures); }
/** * Set the fixtures path * * @param $basePath */ public static function setFixtures($basePath = null) { if (!$basePath) { $basePath = file_exists(base_path('tests')) ? base_path('tests') : app_path('tests'); } $finder = new FixturesFinder($basePath); static::$fixtures = Yaml::parse($finder->find()); }
public static function setUpBeforeClass() { static::$fixtures = __DIR__ . '/fixtures/'; static::$cacheDir = __DIR__ . '/tmp'; static::$dumpDir = __DIR__ . '/dump'; static::$configDir = __DIR__ . '/../../../../../src/CSanquer/FakeryGenerator/Resources/Config'; static::$originalConfigDir = static::$configDir; }
public function setUp() { ini_set('xdebug.max_nesting_level', 400); $client = static::createClient(); static::$manager = $client->getContainer()->get('h4cc_alice_fixtures.manager'); static::$manager->addProcessor(new UserProcessor($client->getContainer())); static::$fixtures = static::$manager->loadFiles([dirname(__FILE__) . '/../Fixtures/UsersSet.yml', dirname(__FILE__) . '/../Fixtures/PlaceAddressSet.yml', dirname(__FILE__) . '/../Fixtures/CategorySet.yml', dirname(__FILE__) . '/../Fixtures/PlaceSet.yml']); static::$manager->persist(static::$fixtures, true); }
public static function setUpBeforeClass() { self::bootKernel(); /** * @var Loader $fixtureLoader; */ $fixtureLoader = static::$kernel->getContainer()->get('hautelook_alice.alice.fixtures.loader'); static::$fixtures = $fixtureLoader->load(__DIR__ . '/../DataFixtures/ORM/user.yml'); /** @var EntityManager $em */ static::$em = static::$kernel->getContainer()->get("doctrine")->getManager(); foreach (static::$fixtures as $fixture) { static::$em->persist($fixture); } static::$em->flush(); }
/** * Remove fixtures * * @return void */ public static function removeFixtures() { static::$fixtures = null; \Includes\Utils\FileManager::deleteFile(static::getFixturesFilePath()); }
/** * Setup fixtures for all tests */ public static function setUpFixtures() { $fixtures = array(); $basePath = __DIR__ . '/fixtures'; static::$fixtures = static::fillArrayWithFileNodes(new DirectoryIterator($basePath)); }