Skip to content

Commit

Permalink
Merge pull request #13 from silasjoisten/feature/codecov
Browse files Browse the repository at this point in the history
codecov
  • Loading branch information
Silas Joisten authored May 16, 2018
2 parents cc65ca4 + 4911c20 commit 2bde287
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions src/Controller/MultiUploadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;

/**
* @codeCoverageIgnore
*/
class MultiUploadController extends MediaAdminController
{
/**
Expand Down
16 changes: 16 additions & 0 deletions tests/Form/MultiUploadTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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();
Expand Down

0 comments on commit 2bde287

Please sign in to comment.