Skip to content

Commit

Permalink
chore: remove last references to database cache
Browse files Browse the repository at this point in the history
  • Loading branch information
alexislefebvre committed Apr 14, 2024
1 parent f3cb461 commit 10c13fd
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 46 deletions.
3 changes: 0 additions & 3 deletions doc/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ Methods

It also give access to other helpers:

- `setDatabaseCacheEnabled()` accept `true` or `false` to disable the cache
- you can call `$this->databaseTool->withDatabaseCacheEnabled(false)->loadFixtures(…)` to disable the cache on-demand

- `setPurgeMode()` accept `true` or `false` to disable purging the database
- you can call `$this->databaseTool->withPurgeMode(false)->loadFixtures(…)` to disable the purging on-demand

Expand Down
1 change: 0 additions & 1 deletion doc/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ declare(strict_types=1);

namespace Liip\Acme\Tests\AppConfigEvents\EventListener;

use Liip\TestFixturesBundle\Event\PreFixtureBackupRestoreEvent;
use Liip\TestFixturesBundle\LiipTestFixturesEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

Expand Down
9 changes: 0 additions & 9 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ public function getConfigTreeBuilder(): TreeBuilder

$rootNode
->children()
->arrayNode('cache_db')
->addDefaultsIfNotSet()
->ignoreExtraKeys(false)
->children()
->scalarNode('sqlite')
->defaultNull()
->end()
->end()
->end()
->booleanNode('keep_database_and_schema')->defaultFalse()->end()
->booleanNode('cache_metadata')->defaultTrue()->end()
;
Expand Down
15 changes: 1 addition & 14 deletions src/DependencyInjection/LiipTestFixturesExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,7 @@ public function load(array $configs, ContainerBuilder $container): void
$loader->load('database_tools.xml');

foreach ($config as $key => $value) {
// If the node is an array,
// e.g. "liip_test_fixtures.cache_db.mysql",
// set the value as
// "liip_test_fixtures.cache_db.mysql"
// instead of an array "liip_test_fixtures.cache_db"
// with a "mysql" key.
if (\is_array($value)) {
foreach ($value as $key2 => $value2) {
$container->setParameter($this->getAlias().'.'.$key.
'.'.$key2, $value2);
}
} else {
$container->setParameter($this->getAlias().'.'.$key, $value);
}
$container->setParameter($this->getAlias().'.'.$key, $value);
}
}
}
15 changes: 0 additions & 15 deletions src/Resources/config/database_tools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,6 @@
<argument type="service" id="doctrine_mongodb.odm.symfony.fixtures.loader" on-invalid="null"/>
</service>

<service id="Liip\TestFixturesBundle\Services\DatabaseBackup\SqliteDatabaseBackup" public="true">
<argument type="service" id="service_container" />
<argument type="service" id="Liip\TestFixturesBundle\Services\FixturesLoaderFactory" />
</service>

<service id="Liip\TestFixturesBundle\Services\DatabaseBackup\MysqlDatabaseBackup" public="true">
<argument type="service" id="service_container" />
<argument type="service" id="Liip\TestFixturesBundle\Services\FixturesLoaderFactory" />
</service>

<service id="Liip\TestFixturesBundle\Services\DatabaseBackup\MongodbDatabaseBackup" public="true">
<argument type="service" id="service_container" />
<argument type="service" id="Liip\TestFixturesBundle\Services\MongoDBFixturesLoaderFactory" />
</service>

<service id="Liip\TestFixturesBundle\Services\DatabaseTools\ORMDatabaseTool" public="false">
<argument type="service" id="service_container" />
<argument type="service" id="Liip\TestFixturesBundle\Services\FixturesLoaderFactory" />
Expand Down
6 changes: 2 additions & 4 deletions tests/AppConfig/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ framework:

# Define all the available parameters in this Bundle
liip_test_fixtures:
cache_db:
sqlite: 'Liip\TestFixturesBundle\Services\DatabaseBackup\SqliteDatabaseBackup'
mysql: 'Liip\TestFixturesBundle\Services\DatabaseBackup\MysqlDatabaseBackup'
mongodb: 'Liip\TestFixturesBundle\Services\DatabaseBackup\MongodbDatabaseBackup'
keep_database_and_schema: true
cache_metadata: true

services:
# HautelookAliceBundle: custom Faker provider
Expand Down

0 comments on commit 10c13fd

Please sign in to comment.