File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -564,7 +564,6 @@ public function testOneBelongsToManyJoinDataAssociatedWithIds()
564
564
*/
565
565
public function testBelongsToManyWithMixedData ()
566
566
{
567
-
568
567
$ data = [
569
568
'title ' => 'My title ' ,
570
569
'body ' => 'My content ' ,
@@ -593,13 +592,18 @@ public function testBelongsToManyWithMixedData()
593
592
]
594
593
]);
595
594
595
+ $ this ->assertEquals ($ data ['tags ' ][0 ]['name ' ], $ article ->tags [0 ]->name );
596
+ $ this ->assertEquals ($ data ['tags ' ][1 ]['name ' ], $ article ->tags [1 ]->name );
596
597
$ this ->assertEquals ($ article ->tags [2 ], $ tags ->get (1 ));
597
598
598
- $ tag_count = $ tags ->find ()->count ();
599
- $ articles ->save ($ article );
599
+ $ this ->assertEquals ($ article ->tags [0 ]->isNew (), true );
600
+ $ this ->assertEquals ($ article ->tags [1 ]->isNew (), true );
601
+ $ this ->assertEquals ($ article ->tags [2 ]->isNew (), false );
600
602
601
- $ this ->assertEquals ($ tag_count + 2 , $ tags ->find ()->count ());
603
+ $ tagCount = $ tags ->find ()->count ();
604
+ $ articles ->save ($ article );
602
605
606
+ $ this ->assertEquals ($ tagCount + 2 , $ tags ->find ()->count ());
603
607
}
604
608
605
609
/**
You can’t perform that action at this time.
0 commit comments