Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

ArrayDataSet: invalid initialization for mixed rows #179

Closed
balland opened this issue Jul 12, 2016 · 7 comments
Closed

ArrayDataSet: invalid initialization for mixed rows #179

balland opened this issue Jul 12, 2016 · 7 comments
Labels

Comments

@balland
Copy link

balland commented Jul 12, 2016

I have found out that the same list of columns should be used for all the rows even if this is not strictly needed.

The problem comes from the constructor of ArrayDataSet. The first row is used to decide which columns are available:
https://github.com/sebastianbergmann/dbunit/blob/master/src/Extensions/Database/DataSet/ArrayDataSet.php#L44

It would be more user-friendly to calculate the union of all the rows keys. And if this is not possible, at least yell during the construction instead of setting silently to null all the remaining columns.

@RusAlex
Copy link

RusAlex commented Aug 10, 2016

Also met this limitation.

At least this behavior should be documented. With "IMPORTANT" label. It was hard to realize why columns were not populated.

@stale
Copy link

stale bot commented Apr 18, 2018

This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 18, 2018
@nCrazed
Copy link

nCrazed commented Apr 19, 2018

The first row is used to decide which columns are available

It's worse than that, row with index 0 is used. So if you build an array via something like array_filter and forget to reset the keys, you will get no columns at all.

@stale
Copy link

stale bot commented Jun 18, 2018

This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 18, 2018
@nCrazed
Copy link

nCrazed commented Jun 19, 2018

@sebastianbergmann I am still happy to implement a fix for this, just need a conformation that my proposed changes would be considered correct.

@stale stale bot removed the stale label Jun 19, 2018
@stale
Copy link

stale bot commented Aug 18, 2018

This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 18, 2018
@stale
Copy link

stale bot commented Aug 25, 2018

This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions.

@stale stale bot closed this as completed Aug 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants