FIX Prevent vacuum from running multiple times during test runs

This commit is contained in:
Guy Marriott 2019-05-01 11:56:41 +12:00
parent e123f69b7b
commit 6b5a18503a
No known key found for this signature in database
GPG Key ID: A80F9ACCB86D3DA7
2 changed files with 59 additions and 0 deletions

8
_config/dev.yml Normal file
View File

@ -0,0 +1,8 @@
---
Name: postgrestest
---
SilverStripe\Core\Injector\Injector:
SilverStripe\Dev\State\SapphireTestState:
properties:
States:
disablepostgresvacuum: '%$SilverStripe\PostgreSQL\Dev\State\DisableVacuumState'

View File

@ -0,0 +1,51 @@
<?php
namespace SilverStripe\PostgreSQL\Dev\State;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Dev\State\TestState;
use SilverStripe\PostgreSQL\PostgreSQLSchemaManager;
class DisableVacuumState implements TestState
{
/**
* Called on setup
*
* @param SapphireTest $test
*/
public function setUp(SapphireTest $test)
{
// TODO: Implement setUp() method.
}
/**
* Called on tear down
*
* @param SapphireTest $test
*/
public function tearDown(SapphireTest $test)
{
// TODO: Implement tearDown() method.
}
/**
* Called once on setup
*
* @param string $class Class being setup
*/
public function setUpOnce($class)
{
Config::modify()->set(PostgreSQLSchemaManager::class, 'check_and_repair_on_build', false);
}
/**
* Called once on tear down
*
* @param string $class Class being torn down
*/
public function tearDownOnce($class)
{
// TODO: Implement tearDownOnce() method.
}
}