Skip to content

Commit 093c200

Browse files
committed
fixed failing tests
1 parent a27c01e commit 093c200

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

tests/Unit/Blueprint/Exporters/ExporterTest.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace Toramanlis\Tests\Unit\Blueprint\Exporters;
44

5+
use ReflectionMethod;
56
use Toramanlis\ImplicitMigrations\Blueprint\Exporters\ColumnDiffExporter;
7+
use Toramanlis\ImplicitMigrations\Blueprint\Exporters\ColumnExporter;
68
use Toramanlis\ImplicitMigrations\Blueprint\Exporters\Exporter;
79
use 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
}

tests/_data/database/migrations/0000_00_00_000000_0_implicit_migration_create_links_table.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ public function tableUp(Blueprint $table): void
2424
$table->string('url');
2525
$table->string('old_url');
2626

27-
$table->foreign(['promotion_id', 'affiliate_id'])
28-
->on('promotions')->references('id');
27+
$table->foreign(['promotion_id', 'affiliate_id'])->on('promotions')->references('id');
2928
$table->foreign('url')->on('redirections')->references('to');
3029
$table->foreign('old_url')->on('redirections')->references('from');
3130
}

0 commit comments

Comments
 (0)