Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct SchemaManagerFunctionalTestCase::testDropsDatabaseWithActiveConnections() on OracleDB #2254

Merged
merged 1 commit into from
Jan 5, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Doctrine\Common\EventManager;
use Doctrine\DBAL\Events;
use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Schema\Comparator;
Expand Down Expand Up @@ -51,10 +52,19 @@ public function testDropsDatabaseWithActiveConnections()

$this->_sm->dropAndCreateDatabase('test_drop_database');

$this->assertContains('test_drop_database', $this->_sm->listDatabases());
$knownDatabases = $this->_sm->listDatabases();
if ($this->_conn->getDatabasePlatform() instanceof OraclePlatform) {
Copy link
Member

Choose a reason for hiding this comment

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

This indicates a separate issue inside the OraclePlatform IMO. Shouldn't the uppercase conversion happen in there, if upper case is enforced?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well - the table name is uppercased and all tables are returned uppercase - on the api usage side I see no way to know if upper or lowercase is expected.

but maybe I'm not deep enough in this oracle fun 🙊

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Ocramius where do we want to go with this? I'm open for any alternative approarch - let me know ... THX

Copy link
Member

Choose a reason for hiding this comment

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

I think this is acceptable, given your feedback. /cc @deeky666

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is acceptable, given your feedback. /cc @deeky666

@deeky666 do you agree? Can we merge this? THX

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deeky666 do you agree? Can we merge this? THX

ping

$this->assertContains('TEST_DROP_DATABASE', $knownDatabases);
} else {
$this->assertContains('test_drop_database', $knownDatabases);
}

$params = $this->_conn->getParams();
$params['dbname'] = 'test_drop_database';
if ($this->_conn->getDatabasePlatform() instanceof OraclePlatform) {
$params['user'] = 'test_drop_database';
} else {
$params['dbname'] = 'test_drop_database';
}

$user = isset($params['user']) ? $params['user'] : null;
$password = isset($params['password']) ? $params['password'] : null;
Expand All @@ -63,11 +73,11 @@ public function testDropsDatabaseWithActiveConnections()

$this->assertInstanceOf('Doctrine\DBAL\Driver\Connection', $connection);

unset($connection);

$this->_sm->dropDatabase('test_drop_database');

$this->assertNotContains('test_drop_database', $this->_sm->listDatabases());

unset($connection);
}

/**
Expand Down