single-table-inheritance icon indicating copy to clipboard operation
single-table-inheritance copied to clipboard

Create a test case for mutated attributes

Open sarahmarshy opened this issue 3 years ago • 1 comments

These changes show a failure test case for newFromBuilder when an object has mutated attributes.

This basically comes from using the setRawAttributesFunction here when filtering out attributes.

If you used a loop for setting attributes, I think this could be fixed.

Related to #70

sarahmarshy avatar Sep 03 '21 21:09 sarahmarshy

I'm not sure I understand the test case here. The first test you added show's everything working as you'd expect using classes. newFromBuilder is an internal API and isn't intended to be called directly like this so the fact this test case files isn't necessarily a surprise.

Note also that the second new test fails if you remove the SingleTableInheritanceTrait. That indicates this pattern is just broken in general in Eloquent vs this being a problem with this package.

jonspalmer avatar Sep 04 '21 02:09 jonspalmer