Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ env:
- TEST_COMMAND="php vendor/bin/phpunit"
- COVERAGE=false
matrix:
- SYMFONY_VERSION=2.7.*
- SYMFONY_VERSION=2.8.*
- SYMFONY_VERSION=3.0.*
- SYMFONY_VERSION=2.7.*
- SYMFONY_VERSION=2.8.*
- SYMFONY_VERSION=3.0.*

branches:
except:
- /^analysis-.*$/

matrix:
fast_finish: true
Expand Down
33 changes: 17 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "cache/cache-bundle",
"type": "library",
"description": "Symfony 2 bundle providing integration between PSR-6 compliant cache services and the framework. It supports cache for sessions, routing and Doctrine",
"keywords": [
"name": "cache/cache-bundle",
"type": "library",
"description": "Symfony 2 bundle providing integration between PSR-6 compliant cache services and the framework. It supports cache for sessions, routing and Doctrine",
"keywords": [
"cache",
"psr6",
"doctrine",
"router",
"session"
],
"homepage": "http://www.php-cache.com/en/latest/",
"license": "MIT",
"authors": [
"homepage": "http://www.php-cache.com/en/latest/",
"license": "MIT",
"authors": [
{
"name": "Aaron Scherer",
"email": "aequasi@gmail.com",
Expand All @@ -23,22 +23,23 @@
"homepage": "https://github.com/nyholm"
}
],
"require": {
"php": "^5.5|^7.0",
"symfony/framework-bundle": "^2.7|^3.0",
"cache/taggable-cache": "^0.4",
"cache/session-handler": "^0.1"
"require": {
"php": "^5.5 || ^7.0",
"symfony/framework-bundle": "^2.7 || ^3.0",
"cache/taggable-cache": "^0.4",
"cache/session-handler": "^0.1"
},
"require-dev": {
"phpunit/phpunit": "^5.1|^4.0",
"phpunit/phpunit": "^5.1 || ^4.0",
"symfony/symfony": "^2.7 || ^3.0",
"cache/psr-6-doctrine-bridge": "^2.0",
"cache/array-adapter": "^0.4"
"cache/array-adapter": "^0.4"
},
"suggest": {
"suggest": {
"cache/adapter-bundle": "To register PSR-6 compliant cache implementations as services.",
"cache/psr-6-doctrine-bridge": "To be able to use Doctrine query, result and metadata cache."
},
"autoload": {
"autoload": {
"psr-4": {
"Cache\\CacheBundle\\": "src/"
}
Expand Down
6 changes: 1 addition & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="CacheBundle for the Symfony2 Framework">
<testsuite name="Main testsuite for CacheBundle">
<directory>./tests/</directory>
</testsuite>
</testsuites>

<logging>
<log type="coverage-text" target="php://stdout"/>
</logging>

<groups>
<exclude>
<group>benchmark</group>
Expand Down
33 changes: 33 additions & 0 deletions tests/Functional/BaseTestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/*
* This file is part of php-cache\cache-bundle package.
*
* (c) 2015-2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Cache\CacheBundle\Tests\Functional;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class BaseTestCase extends WebTestCase
{
protected static function getKernelClass()
{
require_once __DIR__.'/app/AppKernel.php';

return 'Cache\CacheBundle\Tests\Functional\app\AppKernel';
}

protected static function createKernel(array $options = [])
{
$class = self::getKernelClass();

return new $class(
isset($options['config']) ? $options['config'] : 'default.yml'
);
}
}
20 changes: 20 additions & 0 deletions tests/Functional/BundleInitializationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* This file is part of php-cache\cache-bundle package.
*
* (c) 2015-2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Cache\CacheBundle\Tests\Functional;

class BundleInitializationTest extends BaseTestCase
{
public function testRegisterBundle()
{
static::createClient();
}
}
66 changes: 66 additions & 0 deletions tests/Functional/app/AppKernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

/*
* This file is part of php-cache\cache-bundle package.
*
* (c) 2015-2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Cache\CacheBundle\Tests\Functional\app;

use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Kernel;

class AppKernel extends Kernel
{
private $config;

public function __construct($config)
{
parent::__construct('test', true);

$fs = new Filesystem();

if (!$fs->isAbsolutePath($config)) {
$config = __DIR__.'/config/'.$config;
}

if (!file_exists($config)) {
throw new \RuntimeException(sprintf('The config file "%s" does not exist', $config));
}

$this->config = $config;
}

public function registerBundles()
{
return [
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new \Cache\CacheBundle\CacheBundle(),
];
}

public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->config);
}

public function getCacheDir()
{
return sys_get_temp_dir().'/TestBundle';
}

public function serialize()
{
return $this->config;
}

public function unserialize($config)
{
$this->__construct($config);
}
}
2 changes: 2 additions & 0 deletions tests/Functional/app/config/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports:
- { resource: framework.yml }
11 changes: 11 additions & 0 deletions tests/Functional/app/config/framework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
framework:
secret: test
test: ~
session:
storage_id: session.storage.mock_file
form: false
csrf_protection: false
validation:
enabled: false
router:
resource: "%kernel.root_dir%/config/routing.yml"
Empty file.
2 changes: 1 addition & 1 deletion tests/ContainerTest.php → tests/Unit/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* with this source code in the file LICENSE.
*/

namespace Cache\CacheBundle\Tests;
namespace Cache\CacheBundle\Tests\Unit;

/**
* Class ContainerTest.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* with this source code in the file LICENSE.
*/

namespace Cache\CacheBundle\Tests\DependencyInjection;
namespace Cache\CacheBundle\Tests\Unit\DependencyInjection;

use Cache\CacheBundle\Tests\TestCase;
use Cache\CacheBundle\Tests\Unit\TestCase;

/**
* Class CacheExtensionTest.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* with this source code in the file LICENSE.
*/

namespace Cache\CacheBundle\Tests;
namespace Cache\CacheBundle\Tests\Unit;

use Cache\CacheBundle\KeyNormalizer;

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php → tests/Unit/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* with this source code in the file LICENSE.
*/

namespace Cache\CacheBundle\Tests;
namespace Cache\CacheBundle\Tests\Unit;

use Cache\CacheBundle\DependencyInjection\CacheExtension;
use Symfony\Component\Config\FileLocator;
Expand Down