liip/LiipFunctionalTestBundle — Issue #38: cache_sqlite_db config does not play nic with loadFixtures relying on executor
Author: guilhermeblanco
Created: 2012-02-15 04:26:26+00:00
State: open

Hi,

I am currently using the LiipFunctionalTestBundle using the cached pdo_sqlite driver.
I tried to cache the database through the configuration, but it seems impossible to preserve this state when you rely on executors to be accessed after.

It seems around line 173 of WebTestCase you have a void return, while actually many samples can rely of Executor.
Executors in Doctrine DataFixtures are healthy to name instances to be reused later inside of tests or even in other fixtures. This is achievable using the following like in your fixture class:

```php
$this->addReference('', $referenceValue);
```

whenever you wanna consume it on a test case, all you need to do is:

```php
$executor = $this->loadFixtures(array(
'App\DataFixtures\LoadTestFixtureData'
));
$repository = $executor->getReferenceRepository();

$referenceValue = $repository->getReference('');
```

As you may see, this is very useful when you have ID auto generation, because you may be unable to define which ID is the actual value of your test.

I have no idea how is it possible to be fixed... sorry! =(