/** * @testdox The cache of the loader */ public function testGenerationCache() { // This loading will trigger the caching part of the FixtureWildcardReferenceResolver to // cache the pattern for `@another*` $this->nonIsolatedLoader->loadData(['parameters' => [], \stdClass::class => ['another_dummy' => [], 'dummy' => ['related' => '@another*']]], [], []); // This loading will also the caching part of the FixtureWildcardReferenceResolver. The // cache having the same lifetime as the generation context is what ensures the cache from // the previous loading will not interfer with this one $this->nonIsolatedLoader->loadData(['parameters' => [], \stdClass::class => ['another_dummy_new' => [], 'dummy' => ['related' => '@another*']]], [], []); }
/** * @inheritdoc */ public function loadData(array $data, array $parameters = [], array $objects = []) : ObjectSet { return $this->dataLoader->loadData($data, $parameters, $objects); }
/** * @expectedException \Nelmio\Alice\Throwable\Exception\FixtureNotFoundException */ public function testLoadParsesReferencesInQuotes() { $this->loader->loadData([\stdClass::class => ['dummy1' => ['name' => 'foo'], 'dummy2' => ['dummy' => '\'@dummy1\'']]]); }
/** * @inheritdoc */ public function loadFile(string $file, array $parameters = [], array $objects = []) : ObjectSet { $data = $this->parser->parse($file); return $this->dataLoader->loadData($data, $parameters, $objects); }