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

Add failing unit test related to DBAL-1063 #743

Closed
wants to merge 2 commits into from
Closed

Add failing unit test related to DBAL-1063 #743

wants to merge 2 commits into from

Conversation

flack
Copy link
Contributor

@flack flack commented Dec 14, 2014

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 as SchemaManager::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

@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-1074

We use Jira to track the state of pull requests and the versions they got
included in.

@flack
Copy link
Contributor Author

flack commented Dec 14, 2014

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));
Copy link
Member

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

Copy link
Member

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)

Copy link
Contributor Author

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'));

?

Copy link
Member

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.

@deeky666
Copy link
Member

deeky666 commented Jan 3, 2015

Closing in favour of #764
Thanks @flack

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants