Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit ee1f246

Browse files
committed
Merge pull request #23 from dantleech/testing_comp
[WIP] Integration of testing component
2 parents fa84be6 + 75e5263 commit ee1f246

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+91
-257
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
/vendor/
2-
/Tests/Functional/app/cache/
1+
Tests/Resources/app/cache
2+
Tests/Resources/app/logs
3+
composer.lock
4+
vendor

.travis.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
language: php
22

3-
php:
4-
- 5.3
5-
- 5.4
6-
73
env:
8-
- SYMFONY_VERSION=2.1.*
94
- SYMFONY_VERSION=2.2.*
105
- SYMFONY_VERSION=2.3.*
11-
- SYMFONY_VERSION=dev-master
126

137
before_script:
14-
- ./Tests/Functional/init_travis.sh
8+
- composer require symfony/framework-bundle:${SYMFONY_VERSION} --no-update
9+
- composer install --dev
10+
- vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh
1511

1612
script: phpunit --coverage-text
1713

EventListener/AutoRouteListener.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Doctrine\ODM\PHPCR\DocumentManager;
77
use Symfony\Component\DependencyInjection\ContainerInterface;
88
use Symfony\Cmf\Bundle\RoutingAutoBundle\Document\AutoRoute;
9-
use Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\AutoRouteManager;
109

1110
/**
1211
* Doctrine PHPCR ODM listener for maintaining automatic routes.

Tests/Functional/BaseTestCase.php

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,15 @@
22

33
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Functional;
44

5-
require __DIR__.'/app/AppKernel.php';
6-
75
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
86
use Symfony\Bundle\FrameworkBundle\Console\Application;
7+
use Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Functional\App\AppKernel;
8+
use Symfony\Cmf\Component\Testing\Functional\BaseTestCase as TestingBaseTestCase;
99

10-
class BaseTestCase extends WebTestCase
10+
class BaseTestCase extends TestingBaseTestCase
1111
{
12-
static protected function createKernel(array $options = array())
13-
{
14-
return new AppKernel(
15-
isset($options['config']) ? $options['config'] : 'default.yml'
16-
);
17-
}
18-
19-
public function getContainer()
20-
{
21-
return self::$kernel->getContainer();
22-
}
23-
24-
public function getDm()
25-
{
26-
return $this->getContainer()->get('doctrine_phpcr.odm.document_manager');
27-
}
28-
2912
public function setUp(array $options = array(), $routebase = null)
3013
{
31-
self::$kernel = self::createKernel($options);
32-
self::$kernel->init();
33-
self::$kernel->boot();
34-
3514
$session = $this->getContainer()->get('doctrine_phpcr.session');
3615

3716
if ($session->nodeExists('/test')) {
@@ -50,5 +29,10 @@ public function getApplication()
5029
$application = new Application(self::$kernel);
5130
return $application;
5231
}
32+
33+
public function getDm()
34+
{
35+
return $this->db('PHPCR')->getOm();
36+
}
5337
}
5438

Tests/Functional/Command/RefreshCommandTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Functional\Command;
44

5-
use Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Functional\app\Document\Blog;
65
use Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Functional\BaseTestCase;
7-
use Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Functional\app\Document\Post;
6+
use Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Resources\Document\Blog;
7+
use Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Resources\Document\Post;
8+
89
use Symfony\Component\Console\Input\ArrayInput;
910
use Symfony\Component\Console\Output\NullOutput;
1011
use Symfony\Cmf\Bundle\RoutingAutoBundle\Command\RefreshCommand;

Tests/Functional/EventListener/AutoRouteListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Functional\Subscriber;
44

5-
use Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Functional\app\Document\Blog;
65
use Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Functional\BaseTestCase;
7-
use Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Functional\app\Document\Post;
6+
use Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Resources\Document\Blog;
7+
use Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Resources\Document\Post;
88

99
class AutoRouteListenerTest extends BaseTestCase
1010
{

Tests/Functional/app/AppKernel.php

Lines changed: 0 additions & 51 deletions
This file was deleted.

Tests/Functional/app/config/default.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

Tests/Functional/app/config/doctrine.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

Tests/Functional/app/config/framework.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)