File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,11 @@ public function persist($data)
51
51
{
52
52
foreach ($ this ->persisters as $ persister ) {
53
53
if ($ persister ->supports ($ data )) {
54
- return $ persister ->persist ($ data ) ?? $ data ;
54
+ $ data = $ persister ->persist ($ data ) ?? $ data ;
55
55
}
56
56
}
57
+
58
+ return $ data ;
57
59
}
58
60
59
61
/**
Original file line number Diff line number Diff line change @@ -60,7 +60,15 @@ public function testPersist()
60
60
$ barPersisterProphecy ->supports ($ dummy )->willReturn (true )->shouldBeCalled ();
61
61
$ barPersisterProphecy ->persist ($ dummy )->shouldBeCalled ();
62
62
63
- (new ChainDataPersister ([$ fooPersisterProphecy ->reveal (), $ barPersisterProphecy ->reveal ()]))->persist ($ dummy );
63
+ $ bazPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
64
+ $ bazPersisterProphecy ->supports ($ dummy )->willReturn (true )->shouldBeCalled ();
65
+ $ bazPersisterProphecy ->persist ($ dummy )->shouldBeCalled ();
66
+
67
+ (new ChainDataPersister ([
68
+ $ fooPersisterProphecy ->reveal (),
69
+ $ barPersisterProphecy ->reveal (),
70
+ $ bazPersisterProphecy ->reveal (),
71
+ ]))->persist ($ dummy );
64
72
}
65
73
66
74
public function testRemove ()
You can’t perform that action at this time.
0 commit comments