2
2
3
3
namespace Toramanlis \Tests \Unit \Blueprint \Exporters ;
4
4
5
+ use ReflectionMethod ;
5
6
use Toramanlis \ImplicitMigrations \Blueprint \Exporters \ColumnDiffExporter ;
7
+ use Toramanlis \ImplicitMigrations \Blueprint \Exporters \ColumnExporter ;
6
8
use Toramanlis \ImplicitMigrations \Blueprint \Exporters \Exporter ;
7
9
use Toramanlis \Tests \Unit \BaseTestCase ;
8
10
@@ -13,8 +15,8 @@ public function testWrapsParameters()
13
15
/** @var ColumnDiffExporter */
14
16
$ exporter = $ this ->make (ColumnDiffExporter::class);
15
17
$ 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 '
18
20
);
19
21
20
22
$ this ->assertStringContainsString ("\n" , $ result );
@@ -31,4 +33,26 @@ public function testWrapsVariables()
31
33
32
34
$ this ->assertStringContainsString ("\n" , $ result );
33
35
}
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
+ }
34
58
}
0 commit comments