jsdecena / laracom

Laravel FREE E-Commerce Software
https://jsdecena.github.io/laracom
1.91k stars 861 forks source link

Missing defaults in Category repository prevents saving of category without cover #247

Closed iammikek closed 3 years ago

iammikek commented 3 years ago

Tests\Unit\Categories\CategoryUnitTest::it_can_create_root_category ErrorException: compact(): Undefined variable: cover /Users/mike/Documents/Sites/rd/laracom/project/app/Shop/Categories/Repositories/CategoryRepository.php:83 /Users/mike/Documents/Sites/rd/laracom/project/tests/Unit/Categories/CategoryUnitTest.php:232

Tests\Unit\Categories\CategoryUnitTest::it_can_update_child_category_to_root_category ErrorException: compact(): Undefined variable: cover /Users/mike/Documents/Sites/rd/laracom/project/app/Shop/Categories/Repositories/CategoryRepository.php:117 /Users/mike/Documents/Sites/rd/laracom/project/tests/Unit/Categories/CategoryUnitTest.php:247

Tests\Unit\Categories\CategoryUnitTest::it_can_update_root_category_to_child ErrorException: compact(): Undefined variable: cover /Users/mike/Documents/Sites/rd/laracom/project/app/Shop/Categories/Repositories/CategoryRepository.php:117 /Users/mike/Documents/Sites/rd/laracom/project/tests/Unit/Categories/CategoryUnitTest.php:265

--

There were 2 failures:

Tests\Feature\Admin\Categories\CategoryFeatureTest::it_can_update_the_category Expected status code 302 but received 500. Failed asserting that false is true. /Users/mike/Documents/Sites/rd/laracom/project/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:133 /Users/mike/Documents/Sites/rd/laracom/project/tests/Feature/Admin/Categories/CategoryFeatureTest.php:61

Tests\Unit\Categories\CategoryUnitTest::it_errors_creating_the_category_when_required_fields_are_not_passed Failed asserting that exception of type "ErrorException" matches expected exception "App\Shop\Categories\Exceptions\CategoryInvalidArgumentException". Message was: "compact(): Undefined variable: slug" at /Users/mike/Documents/Sites/rd/laracom/project/app/Shop/Categories/Repositories/CategoryRepository.php:83 /Users/mike/Documents/Sites/rd/laracom/project/tests/Unit/Categories/CategoryUnitTest.php:117 This is consistent with behaviour I'm getting within admin and relates to the cover image. With my local install, even though I have linked storage, I'm not seeing any product images. I ran the command to link storage outside of my homestead instance. ssh'ing in , I get ' symlink(): No such file or directory ' if I run it.

In admin, within categories, I was unable to 'resave' a category to change its status without reattaching an image and this throws cover error.