22
33namespace Toramanlis \Tests \Unit \Blueprint \Exporters ;
44
5+ use ReflectionMethod ;
56use Toramanlis \ImplicitMigrations \Blueprint \Exporters \ColumnDiffExporter ;
7+ use Toramanlis \ImplicitMigrations \Blueprint \Exporters \ColumnExporter ;
68use Toramanlis \ImplicitMigrations \Blueprint \Exporters \Exporter ;
79use Toramanlis \Tests \Unit \BaseTestCase ;
810
@@ -13,8 +15,8 @@ public function testWrapsParameters()
1315 /** @var ColumnDiffExporter */
1416 $ exporter = $ this ->make (ColumnDiffExporter::class);
1517 $ result = $ exporter ->renameColumn (
16- 'a_very_long_name_to_be_renamed_to_something_else ' ,
17- 'another_very_long_name_to_rename_something_else_to '
18+ 'a_very_long_name_to_be_renamed_to_something_else_so_that_it_wraps_to_the_next_line ' ,
19+ 'another_very_long_name_to_rename_something_else_to_which_should_wrap_to_the_next_line '
1820 );
1921
2022 $ this ->assertStringContainsString ("\n" , $ result );
@@ -31,4 +33,26 @@ public function testWrapsVariables()
3133
3234 $ this ->assertStringContainsString ("\n" , $ result );
3335 }
36+
37+ public function testWrapsModifiers ()
38+ {
39+ /** @var ColumnExporter */
40+ $ exporter = $ this ->make (ColumnExporter::class);
41+
42+ $ reflectionMethod = new ReflectionMethod (ColumnExporter::class, 'exportMethodCall ' );
43+ $ reflectionMethod ->setAccessible (true );
44+ $ result = $ reflectionMethod ->invoke (
45+ $ exporter ,
46+ 'someLengthyMethodName ' ,
47+ [
48+ 'some_lengthy_string ' ,
49+ 'another_length_string '
50+ ],
51+ [
52+ '->someLengthyModifierMethodName("with_some_lengthy_parameters_of_its_own") '
53+ ]
54+ );
55+
56+ $ this ->assertStringContainsString ("\n\t-> " , $ result );
57+ }
3458}
0 commit comments