Browse Source

Update user photo helper test

Image directory should be created before copying
dummy image file.
pull/8/merge
Nafies Luthfi 8 years ago
parent
commit
e46b40a8b7
  1. 1
      .travis.yml
  2. 3
      tests/Unit/Helpers/UserPhotoHelperTest.php

1
.travis.yml

@ -8,6 +8,7 @@ before_script:
- travis_retry composer install --prefer-source --no-interaction --dev - travis_retry composer install --prefer-source --no-interaction --dev
- cp .env.example .env - cp .env.example .env
- php artisan key:generate - php artisan key:generate
- php artisan storage:link
script: script:
- vendor/bin/phpunit - vendor/bin/phpunit

3
tests/Unit/Helpers/UserPhotoHelperTest.php

@ -54,6 +54,9 @@ class UserPhotoHelperTest extends TestCase
{ {
$photoPath = 'images/user_photo_path.jpg'; $photoPath = 'images/user_photo_path.jpg';
if (!is_dir(storage_path('app/public/images'))) {
mkdir(storage_path('app/public/images'), 0700);
}
copy(public_path('images/icon_user_1.png'), storage_path('app/public/images/user_photo_path.jpg')); copy(public_path('images/icon_user_1.png'), storage_path('app/public/images/user_photo_path.jpg'));
$this->assertFileExists(storage_path('app/public/images/user_photo_path.jpg')); $this->assertFileExists(storage_path('app/public/images/user_photo_path.jpg'));

Loading…
Cancel
Save