Skip to content

Commit

Permalink
backup existing server config during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Jul 2, 2017
1 parent bc76993 commit 42eddf2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/integration/AbstractHttpApiServerTestCase.php
Expand Up @@ -40,6 +40,10 @@ protected function setUp(): void
$this->markTestSkipped('pcntl extension missing');
}

if (file_exists(__DIR__ . '/../../config/autoload/event_store.local.php')) {
copy(__DIR__ . '/../../config/autoload/event_store.local.php', __DIR__ . '/../../config/autoload/event_store.local.php.copy');
}

$config = include __DIR__ . '/event_store.local.php';
$configFile = '<?php return ' . var_export($config, true) . ';';
// add server config
Expand Down Expand Up @@ -79,6 +83,10 @@ protected function tearDown(): void
// remove server config
unlink(__DIR__ . '/../../config/autoload/event_store.local.php');

if (file_exists(__DIR__ . '/../../config/autoload/event_store.local.php.copy')) {
copy(__DIR__ . '/../../config/autoload/event_store.local.php.copy', __DIR__ . '/../../config/autoload/event_store.local.php');
}

// drop event streams table
$statement = $this->connection->prepare('DROP TABLE event_streams;');
$statement->execute();
Expand Down

0 comments on commit 42eddf2

Please sign in to comment.