Make sure the database is not replaced while we make a backup of the service

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2016-11-08 16:32:41 +01:00
parent c591e29eb3
commit 4393e8003b
No known key found for this signature in database
GPG key ID: E166FD8976B3BAC8

View file

@ -128,6 +128,10 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
}
protected function setUp() {
// overwrite the command bus with one we can run ourselves
$this->commandBus = new QueueBus();
$this->overwriteService('AsyncCommandBus', $this->commandBus);
// detect database access
self::$wasDatabaseAllowed = true;
if (!$this->IsDatabaseAccessAllowed()) {
@ -140,10 +144,6 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
});
}
// overwrite the command bus with one we can run ourselves
$this->commandBus = new QueueBus();
$this->overwriteService('AsyncCommandBus', $this->commandBus);
$traits = $this->getTestTraits();
foreach ($traits as $trait) {
$methodName = 'setUp' . basename(str_replace('\\', '/', $trait));