Skip to content

Commit 7b39111

Browse files
committed
Merge pull request #197 from WouterJ/orm_testing
[WIP] Testing component database changes
2 parents 2ce6714 + a127e3c commit 7b39111

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ env:
1313
before_script:
1414
- composer self-update
1515
- composer require symfony/symfony:${SYMFONY_VERSION} --prefer-source
16-
- vendor/symfony-cmf/testing/bin/travis/doctrine_orm.sh
1716

1817
script: phpunit --coverage-text
1918

Tests/Resources/app/AppKernel.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ class AppKernel extends TestKernel
77
{
88
public function configure()
99
{
10-
$this->requireBundleSets(array(
11-
'default',
12-
'sonata_admin',
13-
'phpcr_odm',
14-
));
10+
$this->requireBundleSet('default');
11+
12+
if ('phpcr' === $this->environment) {
13+
$this->requireBundleSets(array(
14+
'phpcr_odm',
15+
'sonata_admin',
16+
));
17+
} elseif ('orm' === $this->environment) {
18+
$this->requireBundleSet('doctrine_orm');
19+
}
1520

1621
$this->addBundles(array(
1722
new \Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22

33
$loader->import(CMF_TEST_CONFIG_DIR.'/default.php');
4-
$loader->import(CMF_TEST_CONFIG_DIR.'/phpcr_odm.php'); // todo find some way to don't have this in the ORM config
54
$loader->import(CMF_TEST_CONFIG_DIR.'/doctrine_orm.php');
6-
$loader->import(CMF_TEST_CONFIG_DIR.'/sonata_admin.php');
75
$loader->import(__DIR__.'/cmf_routing.yml');
86
$loader->import(__DIR__.'/cmf_routing.orm.yml');

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"require-dev": {
2222
"symfony-cmf/core-bundle": "1.0.*",
23-
"symfony-cmf/testing": "1.0.*",
23+
"symfony-cmf/testing": "1.1.*",
2424
"sonata-project/doctrine-phpcr-admin-bundle": "1.0.*",
2525
"symfony/monolog-bundle": "2.2.*",
2626
"doctrine/orm": "2.3.*"

phpunit.xml.dist

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@
88

99
<testsuites>
1010
<testsuite name="Symfony CmfRoutingBundle Test Suite">
11-
<directory>./Tests</directory>
11+
<directory>./Tests/Unit</directory>
12+
</testsuite>
13+
14+
<testsuite name="phpcr">
15+
<directory>./Tests/Functional</directory>
16+
<exclude>./Tests/Functional/Doctrine/Orm</exclude>
17+
</testsuite>
18+
19+
<testsuite name="orm">
20+
<directory>./Tests/Functional/Doctrine/Orm</directory>
1221
</testsuite>
1322
</testsuites>
1423

@@ -28,4 +37,8 @@
2837
<server name="KERNEL_DIR" value="Tests/Resources/app" />
2938
</php>
3039

40+
<listeners>
41+
<listener class="Symfony\Cmf\Component\Testing\Phpunit\DatabaseTestListener" />
42+
</listeners>
43+
3144
</phpunit>

0 commit comments

Comments
 (0)