Load a only a subset of fixtures from the fixtures folder.

@param  array $selectedFixtures
@return void
351328
protected function loadSomeFixtures($selectedFixtures)
    {
        $fixtures = glob("{$this->config['location']}/*.php");

        foreach ($fixtures as $fixture) {
            $tableName = basename($fixture, '.php');

            if (in_array($tableName, $selectedFixtures)) {
                $this->loadFixture($fixture);
            }
        }
    }
291225
public function load(array $fixturesFiles, array $parameters = [], array $objects = [], PurgeMode $purgeMode = null): array
    {
        $this->logger->info('Loading fixtures.');

        return $this->filesLoader->loadFiles($fixturesFiles, $parameters, $objects)->getObjects();
    }
1296405
def setup_fixtures(self, context):
        
        if getattr(context, 'fixtures', None):
            context.test.fixtures = copy(context.fixtures)

        if getattr(context, 'reset_sequences', None):
            context.test.reset_sequences = context.reset_sequences

        if getattr(context, 'multi_db', None):
            context.test.__class__.multi_db = context.multi_db

        if hasattr(context, 'scenario'):
            load_registered_fixtures(context)
820162
public function up($fixtures = array())
    {
        $location = $this->config['location'];

        if (!is_dir($location)) {
            throw new Exceptions\InvalidFixtureLocationException(
                "Could not find fixtures folder, please make sure $location exists",
                1
            );
        }

        $this->loadFixtures($fixtures);
    }
902832
private function buildRoutes(): void
    {
        if ($this->loaded['routes']) {
            return;
        }

        $this->loaded['routes'] = true;

        $this->routes = new RouteCollection(
            $this->getBaseCodeRoute(),
            $this->getBaseRouteName(),
            $this->getBaseRoutePattern(),
            $this->getBaseControllerName()
        );

        $this->routeBuilder->build($this, $this->routes);

        $this->configureRoutes($this->routes);

        foreach ($this->getExtensions() as $extension) {
            $extension->configureRoutes($this, $this->routes);
        }
    }
786563
private function loadSubContexts($subcontexts)
    {
        foreach ($subcontexts as $path => $subcontext) {
            if (!file_exists($path)) {
                throw new \RuntimeException(sprintf('Subcontext path %s path does not exist.', $path));
            }

            // Load file.
            require_once $path;
        }
    }
1291767
public function _mergeAfterFetchWithSelectedKeys($result, $selectedKeys)
    {
        $this->_mergeAfterFetch($result, $selectedKeys ? empty($selectedKeys) : true);
        foreach ($selectedKeys as $key)
        {
            $this->dataAvailability[$key] = true;
        }
    }
749753
protected function handleForm($selectedPage = null): void
    {
        $this->applyFilters(); // maybe do it in a form event ?
        $this->applySort($this->applySortForm());
        $this->applyPager($selectedPage); // merge with filters ?
    }
912385
protected function isFixtureAlreadyLoaded($fixtureObject)
    {
        if (!$this->loadedFixtures) {
            $this->loadedFixtures = [];

            $loadedFixtures = $this->em->getRepository('OkvpnFixtureBundle:DataFixture')->findAll();
            /** @var DataFixture $fixture */
            foreach ($loadedFixtures as $fixture) {
                $this->loadedFixtures[$fixture->getClassName()] = $fixture->getVersion() ?: '0.0';
            }
        }

        $alreadyLoaded = false;

        if (isset($this->loadedFixtures[get_class($fixtureObject)])) {
            $alreadyLoaded = true;
            $loadedVersion = $this->loadedFixtures[get_class($fixtureObject)];
            if ($fixtureObject instanceof VersionedFixtureInterface
                && version_compare($loadedVersion, $fixtureObject->getVersion()) == -1
            ) {
                if ($fixtureObject instanceof LoadedFixtureVersionAwareInterface) {
                    $fixtureObject->setLoadedVersion($loadedVersion);
                }
                $alreadyLoaded = false;
            }
        }

        return $alreadyLoaded;
    }
1259768
public function load(): void
    {
        try {
            $keys = $this->cache->get(self::INDEXING_KEY);
            if ($keys instanceof Keys) {
                $this->keys = $keys;
                return;
            }
        } catch (CacheException $e) {
            trigger_error($e->getMessage(), E_USER_WARNING);
        }

        $this->keys = new Keys();
    }
833499
public function collections(array $collections) : void {
        foreach ($collections as $name => $callback) {
            $this->make($name, $callback);
        }
    }
77667
public function loadJson(string $fixturePath): string
    {
        if (!file_exists($fixturePath)) {
            throw new FixtureLoaderEx("Fixture $fixturePath does not exist.");
        }

        $lines = file($fixturePath);
        $endLine = -1;
        foreach ($lines as $lineNo => $data) {
            if (substr($data, 0, 2) === '--') {
                $endLine = $lineNo;
            } else {
                break;
            }
        }

        if ($endLine != -1) {
            array_splice($lines, 0, $endLine + 1);
        }

        return implode("\n", $lines);
    }
1262889
public function populate(array $values, bool $overrideExistingVars = false): void
    {
        $updateLoadedVars = false;
        $loadedVars = array_flip(explode(',', $_SERVER['SYMFONY_DOTENV_VARS'] ?? $_ENV['SYMFONY_DOTENV_VARS'] ?? ''));

        foreach ($values as $name => $value) {
            $notHttpName = 0 !== strpos($name, 'HTTP_');
            // don't check existence with getenv() because of thread safety issues
            if (!isset($loadedVars[$name]) && (!$overrideExistingVars && (isset($_ENV[$name]) || (isset($_SERVER[$name]) && $notHttpName)))) {
                continue;
            }

            if ($this->usePutenv) {
                putenv("$name=$value");
            }

            $_ENV[$name] = $value;
            if ($notHttpName) {
                $_SERVER[$name] = $value;
            }

            if (!isset($loadedVars[$name])) {
                $loadedVars[$name] = $updateLoadedVars = true;
            }
        }

        if ($updateLoadedVars) {
            unset($loadedVars['']);
            $loadedVars = implode(',', array_keys($loadedVars));
            $_ENV['SYMFONY_DOTENV_VARS'] = $_SERVER['SYMFONY_DOTENV_VARS'] = $loadedVars;

            if ($this->usePutenv) {
                putenv('SYMFONY_DOTENV_VARS='.$loadedVars);
            }
        }
    }
653043
protected function loadFixturesDisabled()
    {
        if (!$this->config()->load_fixtures) {
            return true;
        }
        
        if ($this->config()->load_fixtures_once && $this->FixturesLoaded) {
            return true;
        }
        
        return false;
    }
282357
protected function loadFromCache() : void
    {
        $data = include $this->cacheFile;
        if (!is_array($data) ||
            !isset($data['routes']) ||
            !is_array($data['routes']) ||
            !isset($data['dispatch_data']) ||
            !is_array($data['dispatch_data'])
        ) {
            throw new \RuntimeException(sprintf(
                'Invalid cache file "%s"',
                $this->cacheFile
            ));
        }

        $this->routes = $data['routes'];
        $this->dispatchData = $data['dispatch_data'];
    }
414832
public function load(array $fixturesFiles, array $parameters = [], array $objects = [], PurgeMode $purgeMode = null): array
    {
        if (null === $purgeMode) {
            $purgeMode = $this->defaultPurgeMode;
        }

        if ($purgeMode != PurgeMode::createNoPurgeMode()) {
            $this->logger->info(
                sprintf(
                    'Purging database with purge mode "%s".',
                    (string) $purgeMode
                )
            );

            $purger = $this->purgerFactory->create($purgeMode);
            $purger->purge();
        }

        return $this->loader->load($fixturesFiles, $parameters, $objects, $purgeMode);
    }
1202206
protected function loadTemplates()
    {
        $templates = $this->templatesObjectBackend->loadObject();
        if (!is_array($templates)) {
            $templates = array();
        }
        
        $this->templates = $templates;
    }