diff --git a/.travis.yml b/.travis.yml index 228cde4..91b5765 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,11 +18,16 @@ matrix: - stage: test php: 7.2 -install: - - make install +before_script: + - travis_retry composer self-update + - travis_retry composer install --no-interaction --prefer-source script: - - make test + - php vendor/bin/phpunit + - php vendor/bin/phpunit --coverage-clover=coverage.xml + +after_success: + - bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN notifications: email: silas.joisten@hotmail.de diff --git a/README.md b/README.md index 8ae2b41..5719e82 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ silasjoisten/sonata-multiupload-bundle [![Total Downloads](https://poser.pugx.org/silasjoisten/sonata-multiupload-bundle/downloads)](https://packagist.org/packages/silasjoisten/sonata-multiupload-bundle) [![Latest Unstable Version](https://poser.pugx.org/silasjoisten/sonata-multiupload-bundle/v/unstable)](https://packagist.org/packages/silasjoisten/sonata-multiupload-bundle) [![License](https://poser.pugx.org/silasjoisten/sonata-multiupload-bundle/license)](https://packagist.org/packages/silasjoisten/sonata-multiupload-bundle) +[![codecov](https://codecov.io/gh/silasjoisten/sonata-multiupload-bundle/branch/master/graph/badge.svg)](https://codecov.io/gh/silasjoisten/sonata-multiupload-bundle) ## Installation diff --git a/src/Controller/MultiUploadController.php b/src/Controller/MultiUploadController.php index 2e38868..4c7ff1e 100644 --- a/src/Controller/MultiUploadController.php +++ b/src/Controller/MultiUploadController.php @@ -10,6 +10,9 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; +/** + * @codeCoverageIgnore + */ class MultiUploadController extends MediaAdminController { /** diff --git a/tests/Form/MultiUploadTypeTest.php b/tests/Form/MultiUploadTypeTest.php index 51a84e1..64d37c0 100755 --- a/tests/Form/MultiUploadTypeTest.php +++ b/tests/Form/MultiUploadTypeTest.php @@ -8,6 +8,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\PreloadedExtension; use Symfony\Component\Form\Test\TypeTestCase; +use Symfony\Component\OptionsResolver\OptionsResolver; class MultiUploadTypeTest extends TypeTestCase { @@ -27,6 +28,21 @@ public function testBuildForm() $form->buildForm($formBuilder, ['provider' => 'sonata.media.provider.image']); } + public function testConfigureOptions() + { + $optionResolver = $this->createMock(OptionsResolver::class); + $optionResolver->expects($this->once()) + ->method('setDefaults') + ->with([ + 'data_class' => '', + 'provider' => '', + 'context' => 'default', + ]); + + $form = new MultiUploadType(); + $form->configureOptions($optionResolver); + } + protected function getExtensions() { $childType = new MultiUploadType();