Skip to content

Commit

Permalink
add default value for alt
Browse files Browse the repository at this point in the history
  • Loading branch information
frasmage committed Mar 31, 2024
1 parent 1751150 commit e470658
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automated-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run phpunit
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml --verbose
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
env:
S3_KEY: ${{ secrets.S3_KEY }}
S3_SECRET: ${{ secrets.S3_SECRET }}
Expand Down
6 changes: 3 additions & 3 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
>
<testsuites>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix="Test.php">./tests/Integration/</directory>
</testsuite>
</testsuites>
<php>
<ini name="display_errors" value="true"/>
</php>
<source>
<coverage>
<include>
<directory suffix=".php">./src/</directory>
</include>
</source>
</coverage>
</phpunit>
27 changes: 0 additions & 27 deletions phpunit.xml.bak

This file was deleted.

4 changes: 4 additions & 0 deletions src/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ class Media extends Model
'size' => 'int',
];

protected $attributes = [
'alt' => '',
];

/**
* {@inheritdoc}
*/
Expand Down
1 change: 0 additions & 1 deletion src/MediaUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Contracts\Filesystem\Filesystem;
use Illuminate\Filesystem\FilesystemManager;
use League\Flysystem\UnableToRetrieveMetadata;
use Mimey\MimeTypes;
use Plank\Mediable\Exceptions\MediaUpload\ConfigurationException;
use Plank\Mediable\Exceptions\MediaUpload\FileExistsException;
use Plank\Mediable\Exceptions\MediaUpload\FileNotFoundException;
Expand Down
1 change: 1 addition & 0 deletions tests/Factories/ModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'mime_type' => $faker->randomElement($types[$type]['mime_types']),
'aggregate_type' => $type,
'size' => $faker->randomNumber(),
'alt' => $faker->sentence,
];
});

Expand Down

0 comments on commit e470658

Please sign in to comment.