Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Fixes integration test listener #311

Merged
merged 2 commits into from
Apr 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions test/integration/IntegrationTestListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function startTestSuite(TestSuite $suite)
if ($suite->getName() !== 'integration test') {
return;
}
printf("\nIntegration test started.\n");

if (getenv('TESTS_ZEND_DB_ADAPTER_DRIVER_MYSQL')) {
$this->fixtureLoader = new \ZendIntegrationTest\Db\Platform\MysqlFixtureLoader();
Expand All @@ -42,12 +41,17 @@ public function startTestSuite(TestSuite $suite)
$this->fixtureLoader = new \ZendIntegrationTest\Db\Platform\PgsqlFixtureLoader();
}

if (! isset($this->fixtureLoader)) {
return;
}
printf("\nIntegration test started.\n");
$this->fixtureLoader->createDatabase();
}

public function endTestSuite(TestSuite $suite)
{
if ($suite->getName() !== 'integration test') {
if ($suite->getName() !== 'integration test' ||
! isset($this->fixtureLoader)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should read:

if ($suite->getName() !== 'integration test'
    || ! isset($this->fixtureLoader)
) {

(Operators go on the next line, so that we can add more conditions without requiring additional lines of changes.)

I'll fix this on merge.

return;
}
printf("\nIntegration test ended.\n");
Expand Down