Skip to content

Commit e2d3171

Browse files
committed
Merge branch 'develop' of github.com:rappasoft/laravel-patches into develop
2 parents 570e1ba + 1adde70 commit e2d3171

File tree

3 files changed

+50
-26
lines changed

3 files changed

+50
-26
lines changed

tests/Commands/PatchMakeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Rappasoft\LaravelPatches\Tests\Commands;
44

5-
use InvalidArgumentException;
65
use Illuminate\Support\Facades\File;
6+
use InvalidArgumentException;
77
use Rappasoft\LaravelPatches\Tests\TestCase;
88

99
class PatchMakeTest extends TestCase

tests/Commands/PatchTest.php

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ class PatchTest extends TestCase
99
/** @test */
1010
public function it_runs_pending_patches()
1111
{
12-
file_put_contents(database_path('patches/2021_01_01_000000_my_first_patch.php'),
13-
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php'));
12+
file_put_contents(
13+
database_path('patches/2021_01_01_000000_my_first_patch.php'),
14+
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php')
15+
);
1416

1517
$this->assertDatabaseCount('patches', 0);
1618

@@ -28,8 +30,10 @@ public function it_runs_pending_patches()
2830
/** @test */
2931
public function it_increments_the_batch_number_normally()
3032
{
31-
file_put_contents(database_path('patches/2021_01_01_000000_my_first_patch.php'),
32-
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php'));
33+
file_put_contents(
34+
database_path('patches/2021_01_01_000000_my_first_patch.php'),
35+
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php')
36+
);
3337

3438
$this->artisan('patch')->run();
3539

@@ -38,8 +42,10 @@ public function it_increments_the_batch_number_normally()
3842
'batch' => 1,
3943
]);
4044

41-
file_put_contents(database_path('patches/2021_01_02_000000_my_second_patch.php'),
42-
file_get_contents(__DIR__.'/patches/2021_01_02_000000_my_second_patch.php'));
45+
file_put_contents(
46+
database_path('patches/2021_01_02_000000_my_second_patch.php'),
47+
file_get_contents(__DIR__.'/patches/2021_01_02_000000_my_second_patch.php')
48+
);
4349

4450
$this->artisan('patch')->run();
4551

@@ -52,11 +58,15 @@ public function it_increments_the_batch_number_normally()
5258
/** @test */
5359
public function multiple_patches_have_the_same_batch_if_run_at_the_same_time()
5460
{
55-
file_put_contents(database_path('patches/2021_01_01_000000_my_first_patch.php'),
56-
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php'));
61+
file_put_contents(
62+
database_path('patches/2021_01_01_000000_my_first_patch.php'),
63+
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php')
64+
);
5765

58-
file_put_contents(database_path('patches/2021_01_02_000000_my_second_patch.php'),
59-
file_get_contents(__DIR__.'/patches/2021_01_02_000000_my_second_patch.php'));
66+
file_put_contents(
67+
database_path('patches/2021_01_02_000000_my_second_patch.php'),
68+
file_get_contents(__DIR__.'/patches/2021_01_02_000000_my_second_patch.php')
69+
);
6070

6171
$this->artisan('patch')->run();
6272

@@ -76,11 +86,15 @@ public function multiple_patches_have_the_same_batch_if_run_at_the_same_time()
7686
/** @test */
7787
public function it_increments_the_batch_number_by_one_if_step_is_enabled()
7888
{
79-
file_put_contents(database_path('patches/2021_01_01_000000_my_first_patch.php'),
80-
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php'));
81-
82-
file_put_contents(database_path('patches/2021_01_02_000000_my_second_patch.php'),
83-
file_get_contents(__DIR__.'/patches/2021_01_02_000000_my_second_patch.php'));
89+
file_put_contents(
90+
database_path('patches/2021_01_01_000000_my_first_patch.php'),
91+
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php')
92+
);
93+
94+
file_put_contents(
95+
database_path('patches/2021_01_02_000000_my_second_patch.php'),
96+
file_get_contents(__DIR__.'/patches/2021_01_02_000000_my_second_patch.php')
97+
);
8498

8599
$this->artisan('patch', ['--step' => true])->run();
86100

tests/Commands/RollbackTest.php

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ public function it_rollsback_a_patch()
1212
{
1313
Log::shouldReceive('info')->with('Goodbye First');
1414

15-
file_put_contents(database_path('patches/2021_01_01_000000_my_first_patch.php'),
16-
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php'));
15+
file_put_contents(
16+
database_path('patches/2021_01_01_000000_my_first_patch.php'),
17+
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php')
18+
);
1719

1820
$this->assertDatabaseCount('patches', 0);
1921

@@ -42,11 +44,15 @@ public function it_rollsback_all_patches_of_the_previous_batch()
4244
Log::shouldReceive('info')->with('Goodbye First');
4345
Log::shouldReceive('info')->with('Goodbye Second');
4446

45-
file_put_contents(database_path('patches/2021_01_01_000000_my_first_patch.php'),
46-
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php'));
47+
file_put_contents(
48+
database_path('patches/2021_01_01_000000_my_first_patch.php'),
49+
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php')
50+
);
4751

48-
file_put_contents(database_path('patches/2021_01_02_000000_my_second_patch.php'),
49-
file_get_contents(__DIR__.'/patches/2021_01_02_000000_my_second_patch.php'));
52+
file_put_contents(
53+
database_path('patches/2021_01_02_000000_my_second_patch.php'),
54+
file_get_contents(__DIR__.'/patches/2021_01_02_000000_my_second_patch.php')
55+
);
5056

5157
$this->artisan('patch')->run();
5258

@@ -62,11 +68,15 @@ public function it_rollsback_the_correct_patches_with_step()
6268
{
6369
Log::shouldReceive('info')->once();
6470

65-
file_put_contents(database_path('patches/2021_01_01_000000_my_first_patch.php'),
66-
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php'));
71+
file_put_contents(
72+
database_path('patches/2021_01_01_000000_my_first_patch.php'),
73+
file_get_contents(__DIR__.'/patches/2021_01_01_000000_my_first_patch.php')
74+
);
6775

68-
file_put_contents(database_path('patches/2021_01_02_000000_my_second_patch.php'),
69-
file_get_contents(__DIR__.'/patches/2021_01_02_000000_my_second_patch.php'));
76+
file_put_contents(
77+
database_path('patches/2021_01_02_000000_my_second_patch.php'),
78+
file_get_contents(__DIR__.'/patches/2021_01_02_000000_my_second_patch.php')
79+
);
7080

7181
$this->artisan('patch')->run();
7282

0 commit comments

Comments
 (0)