3232use LaravelDoctrine \Fluent \Relations \OneToOne ;
3333use LaravelDoctrine \Fluent \Relations \Relation ;
3434use LogicException ;
35+ use Mockery \Adapter \Phpunit \MockeryPHPUnitIntegration ;
36+ use PHPUnit \Framework \TestCase ;
3537use Tests \FakeEntity ;
3638use Tests \Stubs \Embedabbles \StubEmbeddable ;
3739use Tests \Stubs \StubEntityListener ;
3840
39- class BuilderTest extends \PHPUnit_Framework_TestCase
41+ class BuilderTest extends TestCase
4042{
41- use IsMacroable;
43+ use IsMacroable, MockeryPHPUnitIntegration ;
4244
4345 /**
4446 * @var ClassMetadataBuilder
@@ -82,7 +84,7 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
8284 'simpleArray ' => Type::SIMPLE_ARRAY ,
8385 ];
8486
85- public static function setUpBeforeClass ()
87+ public static function setUpBeforeClass (): void
8688 {
8789 Type::addType (CarbonDateTimeType::CARBONDATETIME , CarbonDateTimeType::class);
8890 Type::addType (CarbonDateTimeTzType::CARBONDATETIMETZ , CarbonDateTimeTzType::class);
@@ -91,7 +93,7 @@ public static function setUpBeforeClass()
9193 Type::addType (ZendDateType::ZENDDATE , ZendDateType::class);
9294 }
9395
94- protected function setUp ()
96+ protected function setUp (): void
9597 {
9698 $ this ->builder = new ClassMetadataBuilder (new ClassMetadataInfo (
9799 FluentEntity::class
@@ -161,7 +163,7 @@ public function test_can_set_table_settings()
161163 public function test_cannot_use_table_settings_for_embeddable ()
162164 {
163165 $ this ->builder ->setEmbeddable ();
164- $ this ->setExpectedException (LogicException::class);
166+ $ this ->expectException (LogicException::class);
165167
166168 $ this ->fluent ->table ('users ' );
167169 }
@@ -222,7 +224,7 @@ public function test_cannot_use_entity_settings_for_embeddable()
222224 {
223225 $ this ->builder ->setEmbeddable ();
224226
225- $ this ->setExpectedException (LogicException::class);
227+ $ this ->expectException (LogicException::class);
226228
227229 $ this ->fluent ->entity ();
228230 }
@@ -374,7 +376,7 @@ public function test_cannot_add_increments_to_embeddable()
374376 {
375377 $ this ->builder ->setEmbeddable ();
376378
377- $ this ->setExpectedException (LogicException::class);
379+ $ this ->expectException (LogicException::class);
378380
379381 $ this ->fluent ->increments ('id ' );
380382 }
@@ -383,7 +385,7 @@ public function test_cannot_add_small_increments_to_embeddable()
383385 {
384386 $ this ->builder ->setEmbeddable ();
385387
386- $ this ->setExpectedException (LogicException::class);
388+ $ this ->expectException (LogicException::class);
387389
388390 $ this ->fluent ->smallIncrements ('id ' );
389391 }
@@ -392,7 +394,7 @@ public function test_cannot_add_big_increments_to_embeddable()
392394 {
393395 $ this ->builder ->setEmbeddable ();
394396
395- $ this ->setExpectedException (LogicException::class);
397+ $ this ->expectException (LogicException::class);
396398
397399 $ this ->fluent ->bigIncrements ('id ' );
398400 }
@@ -640,10 +642,8 @@ public function test_can_embed_embeddables()
640642
641643 public function test_fluent_builder_method_should_exist ()
642644 {
643- $ this ->setExpectedException (
644- InvalidArgumentException::class,
645- 'Fluent builder method [doesNotExist] does not exist '
646- );
645+ $ this ->expectException (InvalidArgumentException::class);
646+ $ this ->expectExceptionMessage ('Fluent builder method [doesNotExist] does not exist ' );
647647
648648 $ this ->fluent ->doesNotExist ();
649649 }
@@ -768,6 +768,8 @@ public function test_can_override_many_to_many_association()
768768
769769 public function test_can_guess_a_one_to_one_relation_name ()
770770 {
771+ $ this ->expectNotToPerformAssertions ();
772+
771773 $ this ->fluent ->oneToOne (FluentEntity::class);
772774
773775 $ this ->fluent ->build ();
@@ -781,6 +783,8 @@ public function test_can_guess_a_one_to_one_relation_name()
781783
782784 public function test_can_guess_a_has_one_relation_name ()
783785 {
786+ $ this ->expectNotToPerformAssertions ();
787+
784788 $ this ->fluent ->hasOne (FluentEntity::class);
785789
786790 $ this ->fluent ->build ();
@@ -794,6 +798,8 @@ public function test_can_guess_a_has_one_relation_name()
794798
795799 public function test_can_guess_a_belongs_to_relation_name ()
796800 {
801+ $ this ->expectNotToPerformAssertions ();
802+
797803 $ this ->fluent ->belongsTo (FluentEntity::class);
798804
799805 $ this ->fluent ->build ();
@@ -807,6 +813,8 @@ public function test_can_guess_a_belongs_to_relation_name()
807813
808814 public function test_can_guess_a_one_to_many_relation_name ()
809815 {
816+ $ this ->expectNotToPerformAssertions ();
817+
810818 $ this ->fluent ->oneToMany (FluentEntity::class)->mappedBy ('fluentEntity ' );
811819
812820 $ this ->fluent ->build ();
@@ -820,6 +828,8 @@ public function test_can_guess_a_one_to_many_relation_name()
820828
821829 public function test_can_guess_a_has_many_relation_name ()
822830 {
831+ $ this ->expectNotToPerformAssertions ();
832+
823833 $ this ->fluent ->hasMany (FluentEntity::class)->mappedBy ('fluentEntity ' );
824834
825835 $ this ->fluent ->build ();
@@ -833,6 +843,8 @@ public function test_can_guess_a_has_many_relation_name()
833843
834844 public function test_can_guess_a_many_to_many_relation_name ()
835845 {
846+ $ this ->expectNotToPerformAssertions ();
847+
836848 $ this ->fluent ->manyToMany (FluentEntity::class);
837849
838850 $ this ->fluent ->build ();
@@ -846,6 +858,8 @@ public function test_can_guess_a_many_to_many_relation_name()
846858
847859 public function test_can_guess_a_belongs_to_many_relation_name ()
848860 {
861+ $ this ->expectNotToPerformAssertions ();
862+
849863 $ this ->fluent ->belongsToMany (FluentEntity::class);
850864
851865 $ this ->fluent ->build ();
0 commit comments