From a2cde8102dac27616da0552d5d58b684f0d0a48f Mon Sep 17 00:00:00 2001 From: Craig Morris Date: Thu, 13 Aug 2020 15:15:31 +0000 Subject: [PATCH] Migrations with fixed timestamp (#319) --- src/Blueprint.php | 4 +- src/Builder.php | 4 +- src/Commands/BuildCommand.php | 4 +- src/Generators/MigrationGenerator.php | 32 +++-- tests/Feature/BlueprintTest.php | 28 ++--- tests/Feature/Commands/BuildCommandTest.php | 6 +- .../Generator/MigrationGeneratorTest.php | 112 ++++++++++++++++++ tests/Unit/BuilderTest.php | 4 +- 8 files changed, 161 insertions(+), 33 deletions(-) diff --git a/src/Blueprint.php b/src/Blueprint.php index 5816d802..c5383017 100644 --- a/src/Blueprint.php +++ b/src/Blueprint.php @@ -70,13 +70,13 @@ public function analyze(array $tokens) return new Tree($registry); } - public function generate(Tree $tree, array $only = [], array $skip = []): array + public function generate(Tree $tree, array $only = [], array $skip = [], $overwriteMigrations = false): array { $components = []; foreach ($this->generators as $generator) { if ($this->shouldGenerate($generator->types(), $only, $skip)) { - $components = array_merge_recursive($components, $generator->output($tree)); + $components = array_merge_recursive($components, $generator->output($tree, $overwriteMigrations)); } } diff --git a/src/Builder.php b/src/Builder.php index fa71a3b5..4a1739c0 100644 --- a/src/Builder.php +++ b/src/Builder.php @@ -6,7 +6,7 @@ class Builder { - public function execute(Blueprint $blueprint, Filesystem $files, string $draft, string $only = '', string $skip = '') + public function execute(Blueprint $blueprint, Filesystem $files, string $draft, string $only = '', string $skip = '', $overwriteMigrations = false) { $cache = []; if ($files->exists('.blueprint')) { @@ -20,7 +20,7 @@ public function execute(Blueprint $blueprint, Filesystem $files, string $draft, $only = array_filter(explode(',', $only)); $skip = array_filter(explode(',', $skip)); - $generated = $blueprint->generate($registry, $only, $skip); + $generated = $blueprint->generate($registry, $only, $skip, $overwriteMigrations); $models = array_merge($tokens['cache'], $tokens['models'] ?? []); diff --git a/src/Commands/BuildCommand.php b/src/Commands/BuildCommand.php index a00fad43..56a23f77 100644 --- a/src/Commands/BuildCommand.php +++ b/src/Commands/BuildCommand.php @@ -21,6 +21,7 @@ class BuildCommand extends Command {draft? : The path to the draft file, default: draft.yaml or draft.yml } {--only= : Comma separated list of file classes to generate, skipping the rest } {--skip= : Comma separated list of file classes to skip, generating the rest } + {--overwrite-migrations : Update existing migration files, if found } '; /** @@ -59,9 +60,10 @@ public function handle() $only = $this->option('only') ?: ''; $skip = $this->option('skip') ?: ''; + $overwriteMigrations = $this->option('overwrite-migrations') ?: false; $blueprint = resolve(Blueprint::class); - $generated = $this->builder->execute($blueprint, $this->files, $file, $only, $skip); + $generated = $this->builder->execute($blueprint, $this->files, $file, $only, $skip, $overwriteMigrations); collect($generated)->each(function ($files, $action) { $this->line(Str::studly($action).':', $this->outputStyle($action)); diff --git a/src/Generators/MigrationGenerator.php b/src/Generators/MigrationGenerator.php index b490fc68..f93ac779 100644 --- a/src/Generators/MigrationGenerator.php +++ b/src/Generators/MigrationGenerator.php @@ -42,7 +42,7 @@ public function __construct($files) $this->files = $files; } - public function output(Tree $tree): array + public function output(Tree $tree, $overwrite = false): array { $output = []; @@ -54,10 +54,11 @@ public function output(Tree $tree): array /** @var \Blueprint\Models\Model $model */ foreach ($tree->models() as $model) { - $path = $this->getPath($model, $sequential_timestamp->addSecond()); + $path = $this->getPath($model, $sequential_timestamp->addSecond(), $overwrite); + $action = $this->files->exists($path) ? 'updated' : 'created'; $this->files->put($path, $this->populateStub($stub, $model)); - $output['created'][] = $path; + $output[$action][] = $path; if (! empty($model->pivotTables())) { foreach ($model->pivotTables() as $pivotSegments) { @@ -68,10 +69,11 @@ public function output(Tree $tree): array } foreach ($created_pivot_tables as $pivotTable => $pivotSegments) { - $path = $this->getPivotTablePath($pivotTable, $sequential_timestamp); + $path = $this->getPivotTablePath($pivotTable, $sequential_timestamp, $overwrite); + $action = $this->files->exists($path) ? 'updated' : 'created'; $this->files->put($path, $this->populatePivotStub($stub, $pivotSegments)); $created_pivot_tables[] = $pivotTable; - $output['created'][] = $path; + $output[$action][] = $path; } return $output; @@ -276,14 +278,26 @@ protected function getClassName(Model $model) return 'Create'.Str::studly($model->tableName()).'Table'; } - protected function getPath(Model $model, Carbon $timestamp) + protected function getPath(Model $model, Carbon $timestamp, $overwrite = false) { - return 'database/migrations/'.$timestamp->format('Y_m_d_His').'_create_'.$model->tableName().'_table.php'; + return $this->getTablePath($model->tableName(), $timestamp, $overwrite); } - protected function getPivotTablePath($tableName, Carbon $timestamp) + protected function getPivotTablePath($tableName, Carbon $timestamp, $overwrite = false) { - return 'database/migrations/'.$timestamp->format('Y_m_d_His').'_create_'.$tableName.'_table.php'; + return $this->getTablePath($tableName, $timestamp, $overwrite); + } + + protected function getTablePath($tableName, Carbon $timestamp, $overwrite = false) + { + $dir = 'database/migrations/'; + $name = '_create_'.$tableName.'_table.php'; + + $file = $overwrite ? collect($this->files->files($dir))->first(function ($file) use ($tableName) { + return str_contains($file, $tableName); + }) : false; + + return $file ? (string) $file : $dir.$timestamp->format('Y_m_d_His').$name; } protected function isLaravel7orNewer() diff --git a/tests/Feature/BlueprintTest.php b/tests/Feature/BlueprintTest.php index 36d1eed9..74fa2b3d 100644 --- a/tests/Feature/BlueprintTest.php +++ b/tests/Feature/BlueprintTest.php @@ -379,7 +379,7 @@ public function generate_uses_registered_generators_and_returns_generated_files( $tree = new Tree(['branch' => ['code', 'attributes']]); $generatorOne->expects('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['one/new.php'], 'updated' => ['one/existing.php'], @@ -394,7 +394,7 @@ public function generate_uses_registered_generators_and_returns_generated_files( $generatorTwo = \Mockery::mock(Generator::class); $generatorTwo->expects('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['two/new.php'], 'updated' => ['two/existing.php'], @@ -429,7 +429,7 @@ public function generate_uses_swapped_generator_and_returns_generated_files() $generatorSwap = \Mockery::mock(Generator::class); $generatorSwap->expects('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['swapped/new.php'], 'updated' => ['swapped/existing.php'], @@ -464,7 +464,7 @@ public function generate_only_one_specific_type() $skip = []; $generatorFoo->shouldReceive('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['foo.php'], ]); @@ -474,7 +474,7 @@ public function generate_only_one_specific_type() $generatorBar = \Mockery::mock(Generator::class); $generatorBar->shouldReceive('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['bar.php'], ]); @@ -484,7 +484,7 @@ public function generate_only_one_specific_type() $generatorBaz = \Mockery::mock(Generator::class); $generatorBaz->shouldReceive('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['baz.php'], ]); @@ -515,7 +515,7 @@ public function generate_only_specific_types() $skip = []; $generatorFoo->shouldReceive('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['foo.php'], ]); @@ -525,7 +525,7 @@ public function generate_only_specific_types() $generatorBar = \Mockery::mock(Generator::class); $generatorBar->shouldReceive('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['bar.php'], ]); @@ -535,7 +535,7 @@ public function generate_only_specific_types() $generatorBaz = \Mockery::mock(Generator::class); $generatorBaz->shouldReceive('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['baz.php'], ]); @@ -566,7 +566,7 @@ public function generate_should_skip_one_specific_type() $skip = ['bar']; $generatorFoo->shouldReceive('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['foo.php'], ]); @@ -576,7 +576,7 @@ public function generate_should_skip_one_specific_type() $generatorBar = \Mockery::mock(Generator::class); $generatorBar->shouldReceive('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['bar.php'], ]); @@ -586,7 +586,7 @@ public function generate_should_skip_one_specific_type() $generatorBaz = \Mockery::mock(Generator::class); $generatorBaz->shouldReceive('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['baz.php'], ]); @@ -617,7 +617,7 @@ public function generate_should_skip_specific_types() $skip = ['bar', 'baz']; $generatorFoo->shouldReceive('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['foo.php'], ]); @@ -637,7 +637,7 @@ public function generate_should_skip_specific_types() $generatorBaz = \Mockery::mock(Generator::class); $generatorBaz->shouldReceive('output') - ->with($tree) + ->with($tree, false) ->andReturn([ 'created' => ['baz.php'], ]); diff --git a/tests/Feature/Commands/BuildCommandTest.php b/tests/Feature/Commands/BuildCommandTest.php index aa5516e3..4e88cff1 100644 --- a/tests/Feature/Commands/BuildCommandTest.php +++ b/tests/Feature/Commands/BuildCommandTest.php @@ -24,7 +24,7 @@ public function it_uses_the_default_draft_file() $builder = $this->mock(Builder::class); $builder->shouldReceive('execute') - ->with(resolve(Blueprint::class), $filesystem, 'draft.yaml', '', '') + ->with(resolve(Blueprint::class), $filesystem, 'draft.yaml', '', '', false) ->andReturn(collect([])); $this->artisan('blueprint:build') @@ -44,7 +44,7 @@ public function it_passes_the_command_args_to_the_builder_in_right_order() $builder = $this->mock(Builder::class); $builder->shouldReceive('execute') - ->with(resolve(Blueprint::class), $filesystem, 'test.yml', 'a,b,c', 'x,y,z') + ->with(resolve(Blueprint::class), $filesystem, 'test.yml', 'a,b,c', 'x,y,z', false) ->andReturn(collect([])); $this->artisan('blueprint:build test.yml --only=a,b,c --skip=x,y,z') @@ -82,7 +82,7 @@ public function it_shows_the_generated_files_groupbed_by_actions() $builder = $this->mock(Builder::class); $builder->shouldReceive('execute') - ->with(resolve(Blueprint::class), $filesystem, 'draft.yaml', '', '') + ->with(resolve(Blueprint::class), $filesystem, 'draft.yaml', '', '', false) ->andReturn(collect([ "created" => [ "file1", diff --git a/tests/Feature/Generator/MigrationGeneratorTest.php b/tests/Feature/Generator/MigrationGeneratorTest.php index d7eab716..32d974b9 100644 --- a/tests/Feature/Generator/MigrationGeneratorTest.php +++ b/tests/Feature/Generator/MigrationGeneratorTest.php @@ -7,6 +7,7 @@ use Blueprint\Tree; use Carbon\Carbon; use Illuminate\Support\Facades\App; +use Symfony\Component\Finder\SplFileInfo; use Tests\TestCase; /** @@ -62,6 +63,10 @@ public function output_writes_migration_for_model_tree($definition, $path, $migr $timestamp_path = str_replace('timestamp', $now->format('Y_m_d_His'), $path); + $this->files->expects('exists') + ->with($timestamp_path) + ->andReturn(false); + $this->files->expects('put') ->with($timestamp_path, $this->fixture($migration)); @@ -71,6 +76,39 @@ public function output_writes_migration_for_model_tree($definition, $path, $migr $this->assertEquals(['created' => [$timestamp_path]], $this->subject->output($tree)); } + /** + * @test + * @dataProvider modelTreeDataProvider + */ + public function output_updates_migration_for_model_tree($definition, $path, $migration) + { + $this->files->expects('stub') + ->with('migration.stub') + ->andReturn(file_get_contents('stubs/migration.stub')); + + $yday = Carbon::yesterday(); + + $yesterday_path = str_replace('timestamp', $yday->format('Y_m_d_His'), $path); + + $this->files->expects('files') + ->with('database/migrations/') + ->andReturn([ + new SplFileInfo($yesterday_path, '', ''), + ]); + + $this->files->expects('exists') + ->with($yesterday_path) + ->andReturn(true); + + $this->files->expects('put') + ->with($yesterday_path, $this->fixture($migration)); + + $tokens = $this->blueprint->parse($this->fixture($definition)); + $tree = $this->blueprint->analyze($tokens); + + $this->assertEquals(['updated' => [$yesterday_path]], $this->subject->output($tree, true)); + } + /** * @test */ @@ -85,6 +123,8 @@ public function output_writes_migration_for_foreign_shorthand() $timestamp_path = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_comments_table.php'); + $this->files->expects('exists')->andReturn(false); + $this->files->expects('put') ->with($timestamp_path, $this->fixture('migrations/foreign-key-shorthand.php')); @@ -109,6 +149,8 @@ public function output_uses_past_timestamp_for_multiple_migrations() $post_path = str_replace('timestamp', $now->copy()->subSecond()->format('Y_m_d_His'), 'database/migrations/timestamp_create_posts_table.php'); $comment_path = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_comments_table.php'); + $this->files->expects('exists')->twice()->andReturn(false); + $this->files->expects('put') ->with($post_path, $this->fixture('migrations/posts.php')); $this->files->expects('put') @@ -140,6 +182,8 @@ public function output_uses_proper_data_type_for_id_columns_in_laravel6() $timestamp_path = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_relationships_table.php'); + $this->files->expects('exists')->andReturn(false); + $this->files->expects('put') ->with($timestamp_path, $this->fixture('migrations/identity-columns-big-increments.php')); @@ -165,6 +209,8 @@ public function output_creates_constraints_for_unconventional_foreign_reference_ $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_comments_table.php'); + $this->files->expects('exists')->andReturn(false); + $this->files->expects('put') ->with($model_migration, $this->fixture('migrations/relationships-constraints.php')); @@ -196,6 +242,8 @@ public function output_creates_constraints_for_unconventional_foreign_reference_ $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_comments_table.php'); + $this->files->expects('exists')->andReturn(false); + $this->files->expects('put') ->with($model_migration, $this->fixture('migrations/relationships-constraints-laravel6.php')); @@ -220,6 +268,8 @@ public function output_also_creates_pivot_table_migration() $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_journeys_table.php'); $pivot_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_diary_journey_table.php'); + $this->files->expects('exists')->twice()->andReturn(false); + $this->files->expects('put') ->with($model_migration, $this->fixture('migrations/belongs-to-many.php')); $this->files->expects('put') @@ -231,6 +281,42 @@ public function output_also_creates_pivot_table_migration() $this->assertEquals(['created' => [$model_migration, $pivot_migration]], $this->subject->output($tree)); } + /** + * @test + */ + public function output_also_updates_pivot_table_migration() + { + $this->files->expects('stub') + ->with('migration.stub') + ->andReturn(file_get_contents('stubs/migration.stub')); + + $yday = Carbon::yesterday(); + + $model_migration = str_replace('timestamp', $yday->format('Y_m_d_His'), 'database/migrations/timestamp_create_journeys_table.php'); + $pivot_migration = str_replace('timestamp', $yday->format('Y_m_d_His'), 'database/migrations/timestamp_create_diary_journey_table.php'); + + $this->files->expects('files') + ->with('database/migrations/') + ->twice() + ->andReturn([ + new SplFileInfo($model_migration, '', ''), + new SplFileInfo($pivot_migration, '', ''), + ]); + + $this->files->expects('exists')->with($model_migration)->andReturn(true); + $this->files->expects('exists')->with($pivot_migration)->andReturn(true); + + $this->files->expects('put') + ->with($model_migration, $this->fixture('migrations/belongs-to-many.php')); + $this->files->expects('put') + ->with($pivot_migration, $this->fixture('migrations/belongs-to-many-pivot.php')); + + $tokens = $this->blueprint->parse($this->fixture('drafts/belongs-to-many.yaml')); + $tree = $this->blueprint->analyze($tokens); + + $this->assertEquals(['updated' => [$model_migration, $pivot_migration]], $this->subject->output($tree, true)); + } + /** * @test */ @@ -252,6 +338,8 @@ public function output_also_creates_pivot_table_migration_laravel6() $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_journeys_table.php'); $pivot_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_diary_journey_table.php'); + $this->files->expects('exists')->twice()->andReturn(false); + $this->files->expects('put') ->with($model_migration, $this->fixture('migrations/belongs-to-many-laravel6.php')); @@ -281,6 +369,8 @@ public function output_also_creates_constraints_for_pivot_table_migration() $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_journeys_table.php'); $pivot_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_diary_journey_table.php'); + $this->files->expects('exists')->twice()->andReturn(false); + $this->files->expects('put') ->with($model_migration, $this->fixture('migrations/belongs-to-many-key-constraints.php')); @@ -316,6 +406,8 @@ public function output_also_creates_constraints_for_pivot_table_migration_larave $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_journeys_table.php'); $pivot_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_diary_journey_table.php'); + $this->files->expects('exists')->twice()->andReturn(false); + $this->files->expects('put') ->with($model_migration, $this->fixture('migrations/belongs-to-many-key-constraints-laravel6.php')); $this->files->expects('put') @@ -343,6 +435,8 @@ public function output_does_not_duplicate_pivot_table_migration() $people_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_people_table.php'); $pivot_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_company_person_table.php'); + $this->files->expects('exists')->times(3)->andReturn(false); + $this->files->expects('put') ->with($company_migration, $this->fixture('migrations/belongs-to-many-duplicated-company.php')); $this->files->expects('put') @@ -378,6 +472,8 @@ public function output_does_not_duplicate_pivot_table_migration_laravel6() $people_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_people_table.php'); $pivot_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_company_person_table.php'); + $this->files->expects('exists')->times(3)->andReturn(false); + $this->files->expects('put') ->with($company_migration, $this->fixture('migrations/belongs-to-many-duplicated-company-laravel6.php')); $this->files->expects('put') @@ -406,6 +502,8 @@ public function output_also_creates_pivot_table_migration_with_custom_name() $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_users_table.php'); $pivot_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_test_table.php'); + $this->files->expects('exists')->twice()->andReturn(false); + $this->files->expects('put') ->with($model_migration, $this->fixture('migrations/custom-pivot-table-name-user.php')); $this->files->expects('put') @@ -438,6 +536,8 @@ public function output_also_creates_pivot_table_migration_with_custom_name_larav $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_users_table.php'); $pivot_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_test_table.php'); + $this->files->expects('exists')->twice()->andReturn(false); + $this->files->expects('put') ->with($model_migration, $this->fixture('migrations/custom-pivot-table-name-user-laravel6.php')); $this->files->expects('put') @@ -465,6 +565,8 @@ public function output_creates_foreign_keys_with_nullable_chained_correctly() $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_carts_table.php'); + $this->files->expects('exists')->andReturn(false); + $this->files ->expects('put') ->with($model_migration, $this->fixture('migrations/nullable-chaining.php')); @@ -497,6 +599,8 @@ public function output_creates_foreign_keys_with_nullable_chained_correctly_lara $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_carts_table.php'); + $this->files->expects('exists')->andReturn(false); + $this->files ->expects('put') ->with($model_migration, $this->fixture('migrations/nullable-chaining-laravel6.php')); @@ -521,6 +625,8 @@ public function output_creates_foreign_keys_with_on_delete() $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_comments_table.php'); + $this->files->expects('exists')->andReturn(false); + $this->files ->expects('put') ->with($model_migration, $this->fixture('migrations/foreign-key-on-delete.php')); @@ -551,6 +657,8 @@ public function output_creates_foreign_keys_with_on_delete_laravel6() $model_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_comments_table.php'); + $this->files->expects('exists')->andReturn(false); + $this->files ->expects('put') ->with($model_migration, $this->fixture('migrations/foreign-key-on-delete-laravel6.php')); @@ -577,6 +685,8 @@ public function output_works_with_polymorphic_relationships() $user_migration = str_replace('timestamp', $now->copy()->subSecond()->format('Y_m_d_His'), 'database/migrations/timestamp_create_users_table.php'); $image_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_images_table.php'); + $this->files->expects('exists')->times(3)->andReturn(false); + $this->files->expects('put') ->with($post_migration, $this->fixture('migrations/polymorphic_relationships_posts_table.php')); $this->files->expects('put') @@ -612,6 +722,8 @@ public function output_works_with_polymorphic_relationships_laravel6() $user_migration = str_replace('timestamp', $now->copy()->subSecond()->format('Y_m_d_His'), 'database/migrations/timestamp_create_users_table.php'); $image_migration = str_replace('timestamp', $now->format('Y_m_d_His'), 'database/migrations/timestamp_create_images_table.php'); + $this->files->expects('exists')->times(3)->andReturn(false); + $this->files->expects('put') ->with($post_migration, $this->fixture('migrations/polymorphic_relationships_posts_table_laravel6.php')); $this->files->expects('put') diff --git a/tests/Unit/BuilderTest.php b/tests/Unit/BuilderTest.php index 0950782e..2fbd0170 100644 --- a/tests/Unit/BuilderTest.php +++ b/tests/Unit/BuilderTest.php @@ -30,7 +30,7 @@ public function execute_builds_draft_content() ->with($tokens + ['cache' => []]) ->andReturn($registry); $blueprint->expects('generate') - ->with($registry, $only, $skip) + ->with($registry, $only, $skip, false) ->andReturn($generated); $blueprint->expects('dump') ->with($generated) @@ -81,7 +81,7 @@ public function execute_uses_cache_and_remembers_models() ->with($tokens + ['cache' => $cache['models']]) ->andReturn($registry); $blueprint->expects('generate') - ->with($registry, $only, $skip) + ->with($registry, $only, $skip, false) ->andReturn($generated); $blueprint->expects('dump') ->with([