-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add failing unit test related to DBAL-1063 #743
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DBAL-1074 We use Jira to track the state of pull requests and the versions they got |
I've added a second test that produces the exception shown in the ticket |
$tableNew->dropIndex('text_idx'); | ||
$tableNew->addIndex(array('test'), 'duplicate'); | ||
$comparator = new Comparator; | ||
$this->_sm->alterTable($comparator->diffTable($tableFetched, $tableNew)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test has no meaningful assertions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I know it causes an exception, but a "success" case should still be defined)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should it be? Something like
$this->assertTrue($tableNew->hasIndex('duplicate'));
$this->assertFalse($tableNew->hasIndex('test_idx'));
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like that, yes. I think you don't need to work on it now, as @deeky666 is checking this particular issue himself after some internal discussion today.
I am not 100% sure, but I think the behavior exposed by this test is one of the factors in DBAL-1063. But even if it wasn't, it is still very confusing that
Table::getIndexes
doesn't return the same thing asSchemaManager::listTableIndexes
when they are both called on the same table.I've written the test against the MySQL SM, but I suspect the same might happen with other platforms as well