File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed
Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,12 @@ public function test_export_creates_zip_file(): void
2929 $ exporter = new ToDataPack ($ this ->getFileMock ());
3030 $ filename = $ exporter ->process ($ membership ->bar ->id , 'datapack-test.zip ' );
3131
32- $ this ->assertTrue ( str_ends_with ( $ filename , 'exports/ 1/datapack-test.zip ' ) );
32+ $ this ->assertSame ( $ filename , '1/datapack-test.zip ' );
3333 }
3434
3535 public function test_export_contains_files (): void
3636 {
37+ $ exportMock = $ this ->getFileMock ();
3738 Storage::fake ('uploads ' );
3839
3940 $ membership = $ this ->setupBarMembership ();
@@ -55,8 +56,9 @@ public function test_export_contains_files(): void
5556 'file_extension ' => $ ingredientCocktailFile ->extension (),
5657 ]);
5758
58- $ exporter = new ToDataPack ($ this -> getFileMock () );
59+ $ exporter = new ToDataPack ($ exportMock );
5960 $ filename = $ exporter ->process ($ membership ->bar ->id , 'datapack-test.zip ' );
61+ $ filename = $ exportMock ->disk ()->path ($ filename );
6062
6163 $ unzippedFilesDisk = Storage::fake ('temp-datapack-unzip ' );
6264
Original file line number Diff line number Diff line change @@ -29,11 +29,12 @@ public function test_export_creates_zip_file(): void
2929 $ exporter = new ToRecipeType ($ this ->getFileMock ());
3030 $ filename = $ exporter ->process ($ membership ->bar ->id , 'recipes.zip ' );
3131
32- $ this ->assertTrue ( str_ends_with ( $ filename , 'exports/ 1/recipes.zip ' ) );
32+ $ this ->assertSame ( $ filename , '1/recipes.zip ' );
3333 }
3434
3535 public function test_default_export_contains_schema_files (): void
3636 {
37+ $ exportMock = $ this ->getFileMock ();
3738 Storage::fake ('uploads ' );
3839
3940 $ membership = $ this ->setupBarMembership ();
@@ -55,8 +56,9 @@ public function test_default_export_contains_schema_files(): void
5556 'file_extension ' => $ ingredientCocktailFile ->extension (),
5657 ]);
5758
58- $ exporter = new ToRecipeType ($ this -> getFileMock () );
59+ $ exporter = new ToRecipeType ($ exportMock );
5960 $ filename = $ exporter ->process ($ membership ->bar ->id , 'recipes.zip ' );
61+ $ filename = $ exportMock ->disk ()->path ($ filename );
6062
6163 $ unzippedFilesDisk = Storage::fake ('temp-recipes-unzip ' );
6264
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ public function test_import_csv_ingredients_from_file(): void
6565 'strength ' => 40 ,
6666 'description ' => 'Bitter liquer ' ,
6767 'origin ' => 'Italy ' ,
68- 'color ' => ' #008800 ' ,
68+ 'color ' => null ,
6969 'bar_id ' => $ membership ->bar_id ,
7070 'created_user_id ' => $ membership ->user_id ,
7171 ]);
Original file line number Diff line number Diff line change 77use Tests \TestCase ;
88use Kami \Cocktail \Models \Ingredient ;
99use Kami \Cocktail \Models \UserShoppingList ;
10+ use Kami \Cocktail \Models \Enums \UserRoleEnum ;
1011use Illuminate \Testing \Fluent \AssertableJson ;
1112use Illuminate \Foundation \Testing \RefreshDatabase ;
12- use Kami \Cocktail \Models \Enums \UserRoleEnum ;
1313
1414class ShoppingListControllerTest extends TestCase
1515{
You can’t perform that action at this time.
0 commit comments