-
Notifications
You must be signed in to change notification settings - Fork 26
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 #14 from rjkip/maintenance/symfony-3-php-7-support
Test support for Symfony LTSes and 3.0, PHP 5 through 7
- Loading branch information
Showing
7 changed files
with
160 additions
and
30 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
sudo: false | ||
language: php | ||
|
||
php: | ||
- 5.4 | ||
- 5.5 | ||
- nightly | ||
- hhvm | ||
|
||
cache: | ||
directories: | ||
- ~/.composer/cache | ||
|
||
before_script: | ||
- composer self-update | ||
- if [ "$SYMFONY_VERSION" != "" ]; then composer require --no-update symfony/config:${SYMFONY_VERSION} symfony/dependency-injection:${SYMFONY_VERSION} symfony/event-dispatcher:${SYMFONY_VERSION} symfony/http-kernel:${SYMFONY_VERSION} symfony/framework-bundle:${SYMFONY_VERSION}; fi; | ||
- if [ "$SYMFONY_EVENT_DISPATCHER_VERSION" != "" ]; then composer require --no-update symfony/event-dispatcher:${SYMFONY_EVENT_DISPATCHER_VERSION}; fi; | ||
- composer install --no-interaction --prefer-source --dev | ||
|
||
script: phpunit --verbose | ||
|
||
matrix: | ||
include: | ||
- php: 5.6 | ||
env: [SYMFONY_VERSION="2.3.*", SYMFONY_EVENT_DISPATCHER_VERSION="2.4.*"] | ||
- php: 5.6 | ||
env: [SYMFONY_VERSION="2.7.*"] | ||
- php: 5.6 | ||
env: [SYMFONY_VERSION="2.8.*"] | ||
- php: 5.6 | ||
env: [SYMFONY_VERSION="3.0.*"] | ||
- php: 7.0 | ||
env: [SYMFONY_VERSION="2.3.*", SYMFONY_EVENT_DISPATCHER_VERSION="2.4.*"] | ||
- php: 7.0 | ||
env: [SYMFONY_VERSION="2.7.*"] | ||
- php: 7.0 | ||
env: [SYMFONY_VERSION="2.8.*"] | ||
- php: 7.0 | ||
env: [SYMFONY_VERSION="3.0.*"] | ||
allow_failures: | ||
- php: nightly | ||
- php: hhvm | ||
fast_finish: true |
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,30 @@ | ||
<?php | ||
|
||
namespace Tmdb\SymfonyBundle\Tests\DependencyInjection; | ||
|
||
use PHPUnit_Framework_TestCase as TestCase; | ||
use Symfony\Component\DependencyInjection\Container; | ||
use Tmdb\SymfonyBundle\Tests\TestKernel; | ||
|
||
final class TmdbSymfonyExtensionTest extends TestCase | ||
{ | ||
/** | ||
* @test | ||
* @group DependencyInjection | ||
*/ | ||
public function all_tmdb_services_can_be_loaded() | ||
{ | ||
$kernel = new TestKernel('test', true); | ||
$kernel->boot(); | ||
|
||
/** @var Container $container */ | ||
$container = $kernel->getContainer(); | ||
$tmdbServiceIds = array_filter($container->getServiceIds(), function ($id) { | ||
return strpos($id, 'tmdb') === 0; | ||
}); | ||
|
||
foreach ($tmdbServiceIds as $serviceId) { | ||
$container->get($serviceId); | ||
} | ||
} | ||
} |
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,39 @@ | ||
<?php | ||
|
||
namespace Tmdb\SymfonyBundle\Tests; | ||
|
||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
use Symfony\Component\HttpKernel\Kernel; | ||
use Tmdb\SymfonyBundle\TmdbSymfonyBundle; | ||
|
||
final class TestKernel extends Kernel | ||
{ | ||
public function registerBundles() | ||
{ | ||
return [ | ||
new FrameworkBundle(), | ||
new TmdbSymfonyBundle() | ||
]; | ||
} | ||
|
||
public function registerContainerConfiguration(LoaderInterface $loader) | ||
{ | ||
$loader->load(__DIR__ . '/config.yml'); | ||
} | ||
|
||
public function getRootDir() | ||
{ | ||
return sys_get_temp_dir() . '/php-tmdb-symfony-test'; | ||
} | ||
|
||
public function getCacheDir() | ||
{ | ||
return $this->getRootDir() . '/cache'; | ||
} | ||
|
||
public function getLogDir() | ||
{ | ||
return $this->getRootDir() . '/logs'; | ||
} | ||
} |
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,4 @@ | ||
framework: | ||
secret: NopeChuckTesta | ||
tmdb_symfony: | ||
api_key: invalidapikey |
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,16 @@ | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
bootstrap="vendor/autoload.php"> | ||
<testsuites> | ||
<testsuite name="php-tmdb-symfony Test Suite"> | ||
<directory>./Tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |