-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from patkar/enhancement/forward-compatibility-ftw
Forward compatibility FTW (PHP 7, Symfony 3)
- Loading branch information
Showing
13 changed files
with
253 additions
and
527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
vendor | ||
composer.phar | ||
composer.lock | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- hhvm | ||
|
||
sudo: false | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer | ||
|
||
env: | ||
- SYMFONY_VERSION=2.8.* | ||
|
||
matrix: | ||
include: | ||
- php: 5.6 | ||
env: SYMFONY_VERSION=2.3.* | ||
- php: 5.6 | ||
env: SYMFONY_VERSION=2.7.* | ||
- php: 7.0 | ||
env: SYMFONY_VERSION=2.8.*@dev | ||
- php: 7.0 | ||
env: SYMFONY_VERSION=^3.0 | ||
- php: 7.0 | ||
env: SYMFONY_VERSION=^3.0@dev | ||
- php: 5.3 | ||
env: COMPOSER_FLAGS="--prefer-lowest" | ||
|
||
before_install: | ||
- composer self-update | ||
- if [ "$COMPOSER_FLAGS" == "--prefer-lowest" ]; then composer require "roave/security-advisories" dev-master --no-update; fi; | ||
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi; | ||
|
||
install: composer update --prefer-source $COMPOSER_FLAGS | ||
|
||
script: | ||
- vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<services> | ||
<service id="dubture_ffmpeg.ffmpeg" class="FFMpeg\FFMpeg" lazy="true"> | ||
<factory class="FFMpeg\FFMpeg" method="create"/> | ||
<argument type="collection"> | ||
<argument key="ffmpeg.binaries">%dubture_ffmpeg.binary%</argument> | ||
<argument key="ffprobe.binaries">%dubture_ffprobe.binary%</argument> | ||
<argument key="timeout">%dubture_ffmpeg.binary_timeout%</argument> | ||
<argument key="ffmpeg.threads">%dubture_ffmpeg.threads_count%</argument> | ||
</argument> | ||
<argument id="logger" type="service"/> | ||
</service> | ||
|
||
<service id="dubture_ffmpeg.ffprobe" class="FFMpeg\FFProbe" lazy="true"> | ||
<factory class="FFMpeg\FFProbe" method="create"/> | ||
<argument type="collection"> | ||
<argument key="ffmpeg.binaries">%dubture_ffmpeg.binary%</argument> | ||
<argument key="ffprobe.binaries">%dubture_ffprobe.binary%</argument> | ||
</argument> | ||
<argument id="logger" type="service"/> | ||
</service> | ||
</services> | ||
</container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dubture_f_fmpeg: | ||
ffmpeg_binary: /usr/local/bin/ffmpeg | ||
ffprobe_binary: /usr/local/bin/ffprobe | ||
binary_timeout: 300 | ||
threads_count: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dubture_f_fmpeg: | ||
ffmpeg_binary: /usr/local/bin/ffmpeg | ||
ffprobe_binary: /usr/local/bin/ffprobe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
namespace Dubture\FFmpegBundle\Tests\Unit\DependencyInjection; | ||
|
||
use Dubture\FFmpegBundle\DependencyInjection\Configuration; | ||
use Dubture\FFmpegBundle\DependencyInjection\DubtureFFmpegExtension; | ||
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionConfigurationTestCase; | ||
|
||
/** | ||
* Test the configuration parsed from YAML. | ||
* | ||
* @author Patrik Karisch <[email protected]> | ||
*/ | ||
class ConfigurationTest extends AbstractExtensionConfigurationTestCase | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function getContainerExtension() | ||
{ | ||
return new DubtureFFmpegExtension(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function getConfiguration() | ||
{ | ||
return new Configuration(); | ||
} | ||
|
||
public function testProcessedMinimumConfigurationContainsAllValues() | ||
{ | ||
$expectedConfiguration = array( | ||
'ffmpeg_binary' => '/usr/local/bin/ffmpeg', | ||
'ffprobe_binary' => '/usr/local/bin/ffprobe', | ||
'binary_timeout' => 60, | ||
'threads_count' => 4, | ||
); | ||
|
||
$sources = array( | ||
__DIR__.'/../../Fixtures/minimum.yml', | ||
); | ||
|
||
$this->assertProcessedConfigurationEquals( | ||
$expectedConfiguration, | ||
$sources | ||
); | ||
} | ||
|
||
public function testProcessedAllConfigurationContainsAllValues() | ||
{ | ||
$expectedConfiguration = array( | ||
'ffmpeg_binary' => '/usr/local/bin/ffmpeg', | ||
'ffprobe_binary' => '/usr/local/bin/ffprobe', | ||
'binary_timeout' => 300, | ||
'threads_count' => 2, | ||
); | ||
|
||
$sources = array( | ||
__DIR__.'/../../Fixtures/all.yml', | ||
); | ||
|
||
$this->assertProcessedConfigurationEquals($expectedConfiguration, $sources); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
Tests/Unit/DependencyInjection/DubtureFFmpegExtensionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
namespace Dubture\FFmpegBundle\Tests\Unit\DependencyInjection; | ||
|
||
use Dubture\FFmpegBundle\DependencyInjection\DubtureFFmpegExtension; | ||
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase; | ||
|
||
/** | ||
* Test the extensions which adds parameters and services | ||
* to the container. | ||
* | ||
* @author Patrik Karisch <[email protected]> | ||
*/ | ||
class DubtureFFmpegExtensionTest extends AbstractExtensionTestCase | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function getContainerExtensions() | ||
{ | ||
return array( | ||
new DubtureFFmpegExtension(), | ||
); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function setUp() | ||
{ | ||
parent::setUp(); | ||
|
||
$this->load(array( | ||
'ffmpeg_binary' => '/usr/local/bin/ffmpeg', | ||
'ffprobe_binary' => '/usr/local/bin/ffprobe', | ||
)); | ||
} | ||
|
||
public function testAfterLoadingTheCorrectParametersHaveBeenSet() | ||
{ | ||
$this->assertContainerBuilderHasParameter('dubture_ffmpeg.binary', '/usr/local/bin/ffmpeg'); | ||
$this->assertContainerBuilderHasParameter('dubture_ffprobe.binary', '/usr/local/bin/ffprobe'); | ||
$this->assertContainerBuilderHasParameter('dubture_ffmpeg.binary_timeout', 60); | ||
$this->assertContainerBuilderHasParameter('dubture_ffmpeg.threads_count', 4); | ||
} | ||
|
||
public function testAfterLoadingTheFFMpegServiceExists() | ||
{ | ||
$this->assertContainerBuilderHasService('dubture_ffmpeg.ffmpeg', 'FFMpeg\FFMpeg'); | ||
} | ||
|
||
public function testAfterLoadingTheFFProbeServiceExists() | ||
{ | ||
$this->assertContainerBuilderHasService('dubture_ffmpeg.ffprobe', 'FFMpeg\FFProbe'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
$file = __DIR__ . '/../vendor/autoload.php'; | ||
if (!file_exists($file)) { | ||
throw new RuntimeException('Install dependencies to run test suite.'); | ||
} | ||
|
||
$autoload = require_once $file; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
{ | ||
"name": "pulse00/ffmpeg-bundle", | ||
"type": "symfony-bundle", | ||
"description": "Symfony bundle to provide PHP-FFmpeg as a Symfony service (https://github.com/alchemy-fr/PHP-FFmpeg)", | ||
"keywords": ["ffmpeg", "multimedia"], | ||
"keywords": ["multimedia", "video processing", "video", "audio processing", "audio", "avconv", "ffmpeg", "avprobe", "ffprobe"], | ||
"license": "MIT", | ||
"type": "symfony-bundle", | ||
"require": { | ||
"php-ffmpeg/php-ffmpeg": "0.5.*@dev" | ||
}, | ||
"minimum-stability": "dev", | ||
"authors": [ | ||
{ | ||
"name": "Robert Gruendler", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"autoload": { | ||
"psr-0": { "Dubture\\FFmpegBundle": "" } | ||
"require": { | ||
"php": "^5.3.9 || ^7.0", | ||
"php-ffmpeg/php-ffmpeg": "^0.5 || ^0.6", | ||
"symfony/dependency-injection": "^2.3 || ^3.0", | ||
"symfony/framework-bundle": "^2.3 || ^3.0" | ||
}, | ||
"target-dir": "Dubture/FFmpegBundle" | ||
|
||
"require-dev": { | ||
"matthiasnoback/symfony-dependency-injection-test": "~0.7", | ||
"phpunit/phpunit": "^4.8" | ||
}, | ||
"autoload": { | ||
"psr-4": { "Dubture\\FFmpegBundle\\": "" } | ||
} | ||
} |
Oops, something went wrong.