@@ -1660,6 +1660,7 @@ public function testMergeAttributesOnInjectIsFalse(): void
16601660 {
16611661 $ entity = new class () extends Entity {
16621662 protected bool $ mergeAttributesOnInject = false ;
1663+
16631664 // The "user" attribute is not for DB
16641665 // The "_secure" attribute is hidden
16651666 protected $ attributes = [
@@ -1684,26 +1685,26 @@ public function testMergeAttributesOnInjectIsFalse(): void
16841685
16851686 $ entity ->injectRawData ([
16861687 // Missing "type", "user" attributes
1687- 'limit ' => 15 ,
1688- '_secure ' => 'Normal ' ,
1689- 'extra ' => 'undefined ' ,
1688+ 'limit ' => 15 ,
1689+ '_secure ' => 'Normal ' ,
1690+ 'extra ' => 'undefined ' ,
16901691 'DB_PAYLOAD_FIELD ' => 'PayloadData ' ,
16911692 ]);
16921693 $ this ->assertSame (
16931694 [
1694- 'limit ' => 15 ,
1695- '_secure ' => 'Normal ' ,
1696- 'extra ' => 'undefined ' ,
1695+ 'limit ' => 15 ,
1696+ '_secure ' => 'Normal ' ,
1697+ 'extra ' => 'undefined ' ,
16971698 'DB_PAYLOAD_FIELD ' => 'PayloadData ' ,
16981699 ],
16991700 $ entity ->toRawArray (),
17001701 );
17011702 $ this ->assertSame (
17021703 [
1703- 'limit ' => 15 ,
1704- 'extra ' => 'undefined ' ,
1704+ 'limit ' => 15 ,
1705+ 'extra ' => 'undefined ' ,
17051706 'payload ' => 'PayloadData ' ,
1706- 'votes ' => null ,
1707+ 'votes ' => null ,
17071708 'reports ' => null ,
17081709 ],
17091710 $ entity ->toArray (),
@@ -1714,6 +1715,7 @@ public function testMergeAttributesOnInjectIsTrue(): void
17141715 {
17151716 $ entity = new class () extends Entity {
17161717 protected bool $ mergeAttributesOnInject = true ;
1718+
17171719 // The "user" attribute is not for DB
17181720 // The "_secure" attribute is hidden
17191721 protected $ attributes = [
@@ -1738,32 +1740,32 @@ public function testMergeAttributesOnInjectIsTrue(): void
17381740
17391741 $ entity ->injectRawData ([
17401742 // Missing "type", "user" attributes
1741- 'limit ' => 15 ,
1742- '_secure ' => 'Normal ' ,
1743- 'extra ' => 'undefined ' ,
1743+ 'limit ' => 15 ,
1744+ '_secure ' => 'Normal ' ,
1745+ 'extra ' => 'undefined ' ,
17441746 'DB_PAYLOAD_FIELD ' => 'PayloadData ' ,
17451747 ]);
17461748 $ this ->assertSame (
17471749 [
1748- 'type ' => 'Normal ' ,
1749- 'limit ' => 15 ,
1750- 'user ' => 'John ' ,
1751- '_secure ' => 'Normal ' ,
1752- 'reports ' => 0 ,
1753- 'extra ' => 'undefined ' ,
1750+ 'type ' => 'Normal ' ,
1751+ 'limit ' => 15 ,
1752+ 'user ' => 'John ' ,
1753+ '_secure ' => 'Normal ' ,
1754+ 'reports ' => 0 ,
1755+ 'extra ' => 'undefined ' ,
17541756 'DB_PAYLOAD_FIELD ' => 'PayloadData ' ,
17551757 ],
17561758 $ entity ->toRawArray (),
17571759 );
17581760 $ this ->assertSame (
17591761 [
1760- 'type ' => 'Normal ' ,
1761- 'limit ' => 15 ,
1762- 'user ' => 'John ' ,
1762+ 'type ' => 'Normal ' ,
1763+ 'limit ' => 15 ,
1764+ 'user ' => 'John ' ,
17631765 'reports ' => null ,
1764- 'extra ' => 'undefined ' ,
1766+ 'extra ' => 'undefined ' ,
17651767 'payload ' => 'PayloadData ' ,
1766- 'votes ' => null ,
1768+ 'votes ' => null ,
17671769 ],
17681770 $ entity ->toArray (),
17691771 );
@@ -2841,4 +2843,4 @@ public function __toString(): string
28412843 $ entity ->email = $ emailClass ::create ('new@example.com ' );
28422844 $ this ->assertFalse ($ entity ->hasChanged ('email ' ));
28432845 }
2844- }
2846+ }
0 commit comments