41
41
42
42
class BuilderTest extends TestCase
43
43
{
44
- use IsMacroable, MockeryPHPUnitIntegration;
44
+ use IsMacroable;
45
+ use MockeryPHPUnitIntegration;
45
46
46
47
/**
47
48
* @var ClassMetadataBuilder
@@ -549,8 +550,9 @@ public function test_has_one_implies_an_inverse_one_to_one()
549
550
550
551
$ result = $ this ->builder ->getClassMetadata ()->associationMappings ['one ' ];
551
552
552
- $ this ->assertFalse ($ result ['isOwningSide ' ],
553
- "HasOne relation is an inversed one-to-one, but resulted in the owning side. "
553
+ $ this ->assertFalse (
554
+ $ result ['isOwningSide ' ],
555
+ 'HasOne relation is an inversed one-to-one, but resulted in the owning side. '
554
556
);
555
557
}
556
558
@@ -703,21 +705,21 @@ public function test_entity_listeners_can_be_configured_through_a_callable()
703
705
[
704
706
'class ' => StubEntityListener::class,
705
707
'method ' => 'swipeFloor ' ,
706
- ]
708
+ ],
707
709
], $ this ->fluent ->getClassMetadata ()->entityListeners ['onFlush ' ]);
708
710
709
711
$ this ->assertEquals ([
710
712
[
711
713
'class ' => StubEntityListener::class,
712
714
'method ' => 'cleanToilet ' ,
713
- ]
715
+ ],
714
716
], $ this ->fluent ->getClassMetadata ()->entityListeners ['postFlush ' ]);
715
717
716
718
$ this ->assertEquals ([
717
719
[
718
720
'class ' => StubEntityListener::class,
719
721
'method ' => 'onClear ' ,
720
- ]
722
+ ],
721
723
], $ this ->fluent ->getClassMetadata ()->entityListeners ['onClear ' ]);
722
724
}
723
725
@@ -745,8 +747,10 @@ public function test_can_override_many_to_one_association()
745
747
746
748
$ this ->fluent ->build ();
747
749
748
- $ this ->assertEquals ('target_id ' ,
749
- $ this ->fluent ->getClassMetadata ()->getAssociationMapping ('manyToOne ' )['joinColumns ' ][0 ]['name ' ]);
750
+ $ this ->assertEquals (
751
+ 'target_id ' ,
752
+ $ this ->fluent ->getClassMetadata ()->getAssociationMapping ('manyToOne ' )['joinColumns ' ][0 ]['name ' ]
753
+ );
750
754
$ this ->assertEquals ('source_id ' , $ this ->fluent ->getClassMetadata ()
751
755
->getAssociationMapping ('manyToOne ' )['joinColumns ' ][0 ]['referencedColumnName ' ]);
752
756
}
@@ -761,8 +765,10 @@ public function test_can_override_many_to_many_association()
761
765
762
766
$ this ->fluent ->build ();
763
767
764
- $ this ->assertEquals ('custom_table_name ' ,
765
- $ this ->fluent ->getClassMetadata ()->getAssociationMapping ('manyToMany ' )['joinTable ' ]['name ' ]);
768
+ $ this ->assertEquals (
769
+ 'custom_table_name ' ,
770
+ $ this ->fluent ->getClassMetadata ()->getAssociationMapping ('manyToMany ' )['joinTable ' ]['name ' ]
771
+ );
766
772
$ this ->assertEquals ('source_id ' , $ this ->fluent ->getClassMetadata ()
767
773
->getAssociationMapping ('manyToMany ' )['joinTable ' ]['joinColumns ' ][0 ]['name ' ]);
768
774
}
@@ -778,7 +784,7 @@ public function test_can_guess_a_one_to_one_relation_name()
778
784
try {
779
785
$ this ->fluent ->getClassMetadata ()->getAssociationMapping ('fluentEntity ' );
780
786
} catch (MappingException $ e ) {
781
- $ this ->fail (" Could not find default name for the oneToOne relation. " . $ e ->getMessage ());
787
+ $ this ->fail (' Could not find default name for the oneToOne relation. ' . $ e ->getMessage ());
782
788
}
783
789
}
784
790
@@ -793,7 +799,7 @@ public function test_can_guess_a_has_one_relation_name()
793
799
try {
794
800
$ this ->fluent ->getClassMetadata ()->getAssociationMapping ('fluentEntity ' );
795
801
} catch (MappingException $ e ) {
796
- $ this ->fail (" Could not find default name for the hasOne relation. " . $ e ->getMessage ());
802
+ $ this ->fail (' Could not find default name for the hasOne relation. ' . $ e ->getMessage ());
797
803
}
798
804
}
799
805
@@ -808,7 +814,7 @@ public function test_can_guess_a_belongs_to_relation_name()
808
814
try {
809
815
$ this ->fluent ->getClassMetadata ()->getAssociationMapping ('fluentEntity ' );
810
816
} catch (MappingException $ e ) {
811
- $ this ->fail (" Could not find default name for the belongsTo relation. " . $ e ->getMessage ());
817
+ $ this ->fail (' Could not find default name for the belongsTo relation. ' . $ e ->getMessage ());
812
818
}
813
819
}
814
820
@@ -823,7 +829,7 @@ public function test_can_guess_a_one_to_many_relation_name()
823
829
try {
824
830
$ this ->fluent ->getClassMetadata ()->getAssociationMapping ('fluentEntities ' );
825
831
} catch (MappingException $ e ) {
826
- $ this ->fail (" Could not find default name for the oneToMany relation. " . $ e ->getMessage ());
832
+ $ this ->fail (' Could not find default name for the oneToMany relation. ' . $ e ->getMessage ());
827
833
}
828
834
}
829
835
@@ -838,7 +844,7 @@ public function test_can_guess_a_has_many_relation_name()
838
844
try {
839
845
$ this ->fluent ->getClassMetadata ()->getAssociationMapping ('fluentEntities ' );
840
846
} catch (MappingException $ e ) {
841
- $ this ->fail (" Could not find default name for the hasMany relation. " . $ e ->getMessage ());
847
+ $ this ->fail (' Could not find default name for the hasMany relation. ' . $ e ->getMessage ());
842
848
}
843
849
}
844
850
@@ -853,7 +859,7 @@ public function test_can_guess_a_many_to_many_relation_name()
853
859
try {
854
860
$ this ->fluent ->getClassMetadata ()->getAssociationMapping ('fluentEntities ' );
855
861
} catch (MappingException $ e ) {
856
- $ this ->fail (" Could not find default name for the manyToMany relation. " . $ e ->getMessage ());
862
+ $ this ->fail (' Could not find default name for the manyToMany relation. ' . $ e ->getMessage ());
857
863
}
858
864
}
859
865
@@ -868,7 +874,7 @@ public function test_can_guess_a_belongs_to_many_relation_name()
868
874
try {
869
875
$ this ->fluent ->getClassMetadata ()->getAssociationMapping ('fluentEntities ' );
870
876
} catch (MappingException $ e ) {
871
- $ this ->fail (" Could not find default name for the belongsToMany relation. " . $ e ->getMessage ());
877
+ $ this ->fail (' Could not find default name for the belongsToMany relation. ' . $ e ->getMessage ());
872
878
}
873
879
}
874
880
@@ -909,5 +915,8 @@ protected function getMacroableBuilder()
909
915
910
916
class FluentEntity
911
917
{
912
- protected $ id , $ name , $ fluentEntity , $ fluentEntities ;
918
+ protected $ id ;
919
+ protected $ name ;
920
+ protected $ fluentEntity ;
921
+ protected $ fluentEntities ;
913
922
}
0 commit comments