DBUnit YamlDataSet does not respect empty tables #132

Closed
elblinkin opened this Issue Jan 21, 2011 · 1 comment

Comments

2 participants
@elblinkin
Contributor

elblinkin commented Jan 21, 2011

A yaml data set file with a 'table_name:' followed by no rows should be treated like an empty table so that TRUNCATE, DELETE, DELETE_ALL, and CLEAN_INSERT can clear out that table on setUp and tearDown operations.

Looks like deleting lines 89-91 in the YamlDataSet should do it:
if (!is_array($rows)) {
continue;
}

As sfYaml seems to not return an empty array, and the remainder of the addYamlFile seems to safely handle the case where $rows is not set when determining column names.

@sebastianbergmann

This comment has been minimized.

Show comment Hide comment
@sebastianbergmann

sebastianbergmann Jan 22, 2011

Owner

michaelmoussa pushed a commit to michaelmoussa/phpunit that referenced this issue Apr 25, 2018

axiac pushed a commit to axiac/phpunit that referenced this issue May 8, 2018

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment