Skip to content

Commit

Permalink
moved tests to folder next to src
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbumbacea committed Dec 13, 2016
1 parent 668c747 commit c35e3e5
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/vendor/
.idea
app/cache/*
app/logs/*
tests/app/cache/*
tests/app/logs/*
reports/
composer.phar
composer.lock
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"psr-4": { "CacheBundle\\": "src/CacheBundle/" },
"psr-0": { "CacheBundle\\Annotation\\": "src/" }
},
"autoload-dev": {
"psr-4": { "CacheBundle\\Tests\\Helpers\\": "tests/Helpers/" }
},
"config": {
"optimize-autoloader": true
}
Expand Down
5 changes: 1 addition & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@
</php>
<testsuites>
<testsuite name="CacheBundle Test Suite">
<directory>./src/CacheBundle/Tests</directory>
<directory>./tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">src</directory>
<exclude>
<directory suffix=".php">src/*Bundle/Tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,13 @@

use CacheBundle\Exception\CacheException;
use CacheBundle\Service\AbstractCache;
use CacheBundle\Service\ApcCache;
use CacheBundle\Service\CouchbaseCache;
use CacheBundle\Service\MemcachedCache;
use CacheBundle\Service\MemoryCache;
use CacheBundle\Service\MultiLevelCache;
use CacheBundle\Service\PsrCompatible;
use CacheBundle\Service\RedisCache;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Cache\Adapter\ArrayAdapter;

/**
* Class CacheServiceTest
*/
class CacheServiceTest extends KernelTestCase
class CacheServiceTest extends \PHPUnit_Framework_TestCase
{

public function cacheProvider()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<?php
/**
* Created by IntelliJ IDEA.
* User: abumbacea
* Date: 07/12/2016
* Time: 14:27
*/

namespace CacheBundle\Tests;


use CacheBundle\ProxyManager\Factory\ProxyCachingObjectFactory;
use CacheBundle\Tests\Helpers\CacheableClass;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheWarmerPass;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
Expand Down Expand Up @@ -53,17 +48,17 @@ public function build(ContainerBuilder $container)

public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__ . '/../../../app/config.yml');
$loader->load(__DIR__ . '/config.yml');
}

public function __construct($environment, $debug)
{
parent::__construct($environment, $debug);

$loader = require __DIR__ . '/../../../vendor/autoload.php';
$loader = require __DIR__ . '/../vendor/autoload.php';

AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
$this->rootDir = __DIR__ . '/../../../app/';
$this->rootDir = __DIR__ . '/app/';
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ public function registerBundles()

public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__ . '/../../../app/config.yml');
$loader->load(__DIR__ . '/config.yml');
}

public function __construct($environment, $debug)
{
parent::__construct($environment, $debug);

$loader = require __DIR__ . '/../../../vendor/autoload.php';
$loader = require __DIR__ . '/../vendor/autoload.php';

AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
$this->rootDir = __DIR__ . '/../../../app/';
$this->rootDir = __DIR__ . '/app/';
}
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php


namespace CacheBundle\Tests;
namespace CacheBundle\Tests\Helpers;


use CacheBundle\Annotation\Cache;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace CacheBundle\Tests;
namespace CacheBundle\Tests\Helpers;


use CacheBundle\Annotation\Cache;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace CacheBundle\Tests;
namespace CacheBundle\Tests\Helpers;


class ExtendedCacheableClass extends ExtendableCacheableClass
Expand Down
4 changes: 2 additions & 2 deletions app/config.yml → tests/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ services:
cache.service:
class: Symfony\Component\Cache\Adapter\ArrayAdapter
cache.testservice:
class: CacheBundle\Tests\CacheableClass
class: CacheBundle\Tests\Helpers\CacheableClass
cache.testservice.extended:
class: CacheBundle\Tests\ExtendedCacheableClass
class: CacheBundle\Tests\Helpers\ExtendedCacheableClass
annotation_reader:
class: Doctrine\Common\Annotations\AnnotationReader

0 comments on commit c35e3e5

Please sign in to comment.