Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fea6b79

Browse filesBrowse files
committed
moved component and bridge unit tests to the src/ directory
This is the first step to make each Symfony Component and Bridge self-contained.
1 parent 3e95126 commit fea6b79
Copy full SHA for fea6b79

File tree

Expand file treeCollapse file tree

861 files changed

+4045
-1216
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

861 files changed

+4045
-1216
lines changed

‎check_cs

Copy file name to clipboardExpand all lines: check_cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $finder
2626
->name('*.xml')
2727
->name('*.xml.dist')
2828
->name('*.yml')
29-
->in(array(__DIR__.'/src', __DIR__.'/tests'))
29+
->in(__DIR__.'/src')
3030
->notName(basename(__FILE__))
3131
->exclude('.git')
3232
->exclude('vendor')

‎phpunit.xml.dist

Copy file name to clipboardExpand all lines: phpunit.xml.dist
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
processIsolation="false"
1010
stopOnFailure="false"
1111
syntaxCheck="false"
12-
bootstrap="tests/bootstrap.php"
12+
bootstrap="autoload.php.dist"
1313
>
1414
<testsuites>
1515
<testsuite name="Symfony Test Suite">
16-
<directory>./tests/Symfony/</directory>
16+
<directory>./src/Symfony/Bridge/*/Tests/</directory>
17+
<directory>./src/Symfony/Component/*/Tests/</directory>
1718
<directory>./src/Symfony/Bundle/*/Tests/</directory>
1819
</testsuite>
1920
</testsuites>
@@ -29,8 +30,10 @@
2930
<whitelist>
3031
<directory>./src/Symfony/</directory>
3132
<exclude>
32-
<directory>./src/Symfony/Bundle/*/Resources</directory>
33+
<directory>./src/Symfony/Bridge/*/Tests</directory>
34+
<directory>./src/Symfony/Component/*/Tests</directory>
3335
<directory>./src/Symfony/Bundle/*/Tests</directory>
36+
<directory>./src/Symfony/Bundle/*/Resources</directory>
3437
<directory>./src/Symfony/Component/*/Resources</directory>
3538
<directory>./src/Symfony/Component/*/*/Resources</directory>
3639
</exclude>

‎src/Symfony/Bridge/Doctrine/README.md

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/README.md
+24-2Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,31 @@ Doctrine Bridge
44
Provides integration for [Doctrine](http://www.doctrine-project.org/) with
55
various Symfony2 components.
66

7+
Twig Bridge
8+
===========
9+
10+
Provides integration for [Twig](http://twig.sensiolabs.org/) with various
11+
Symfony2 components.
12+
713
Resources
814
---------
915

10-
Unit tests:
16+
You can run the unit tests with the following command:
17+
18+
phpunit -c src/Symfony/Bridge/Doctrine/
19+
20+
If you also want to run the unit tests that depend on other Symfony
21+
Components, declare the following environment variables before running
22+
PHPUnit:
1123

12-
https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Bridge/Doctrine
24+
export DOCTRINE_COMMON=../path/to/doctrine-common
25+
export DOCTRINE_DBAL=../path/to/doctrine-dbal
26+
export DOCTRINE_ORM=../path/to/doctrine
27+
export DOCTRINE_FIXTURES=../path/to/doctrine-fixtures
28+
export SYMFONY_HTTP_FOUNDATION=../path/to/HttpFoundation
29+
export SYMFONY_DEPENDENCY_INJECTION=../path/to/DependencyInjection
30+
export SYMFONY_FORM=../path/to/Form
31+
export SYMFONY_SECURITY=../path/to/Security
32+
export SYMFONY_VALIDATOR=../path/to/Validator
33+
export SYMFONY_HTTP_KERNEL=../path/to/HttpKernel
34+
export SYMFONY_EVENT_DISPATCHER=../path/to/EventDispatcher

‎tests/Symfony/Tests/Bridge/Doctrine/ContainerAwareEventManagerTest.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Doctrine\Bundle\DoctrineBundle\Tests;
12+
namespace Symfony\Bridge\Doctrine\Tests;
1313

1414
use Symfony\Bridge\Doctrine\ContainerAwareEventManager;
1515
use Symfony\Component\DependencyInjection\Container;
@@ -18,6 +18,10 @@ class ContainerAwareEventManagerTest extends \PHPUnit_Framework_TestCase
1818
{
1919
protected function setUp()
2020
{
21+
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
22+
$this->markTestSkipped('The "DependencyInjection" component is not available');
23+
}
24+
2125
$this->container = new Container();
2226
$this->evm = new ContainerAwareEventManager($this->container);
2327
}

‎tests/Symfony/Tests/Bridge/Doctrine/DataCollector/DoctrineDataCollectorTest.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php
+12-1Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Tests\Bridge\Doctrine\DataCollector;
12+
namespace Symfony\Bridge\Doctrine\Tests\DataCollector;
1313

1414
use Doctrine\DBAL\Platforms\MySqlPlatform;
1515
use Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector;
@@ -18,6 +18,17 @@
1818

1919
class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
2020
{
21+
protected function setUp()
22+
{
23+
if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) {
24+
$this->markTestSkipped('Doctrine DBAL is not available.');
25+
}
26+
27+
if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) {
28+
$this->markTestSkipped('The "HttpKernel" component is not available');
29+
}
30+
}
31+
2132
public function testCollectConnections()
2233
{
2334
$c = $this->createCollector(array());

‎tests/Symfony/Tests/Bridge/Doctrine/DataFixtures/ContainerAwareLoaderTest.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Tests\Bridge\Doctrine\DataFixtures;
12+
namespace Symfony\Bridge\Doctrine\Tests\DataFixtures;
1313

1414
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader;
15-
use Symfony\Tests\Bridge\Doctrine\Fixtures\ContainerAwareFixture;
15+
use Symfony\Bridge\Doctrine\Tests\Fixtures\ContainerAwareFixture;
1616

1717
class ContainerAwareLoaderTest extends \PHPUnit_Framework_TestCase
1818
{
1919
protected function setUp()
2020
{
21+
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
22+
$this->markTestSkipped('The "DependencyInjection" component is not available');
23+
}
24+
2125
if (!class_exists('Doctrine\Common\DataFixtures\Loader')) {
2226
$this->markTestSkipped('Doctrine Data Fixtures is not available.');
2327
}
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Tests\Bridge\Doctrine\DependencyInjection\Compiler;
12+
namespace Symfony\Bridge\Doctrine\Tests\DependencyInjection\Compiler;
1313

1414
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616

1717
class RegisterEventListenersAndSubscribersPassTest extends \PHPUnit_Framework_TestCase
1818
{
19+
protected function setUp()
20+
{
21+
if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
22+
$this->markTestSkipped('The "DependencyInjection" component is not available');
23+
}
24+
}
25+
1926
public function testProcessEventListenersWithPriorities()
2027
{
2128
$container = $this->createBuilder();

‎tests/Symfony/Tests/Bridge/Doctrine/DoctrineOrmTestCase.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php
+12-4Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Tests\Bridge\Doctrine;
12+
namespace Symfony\Bridge\Doctrine\Tests;
1313

1414
use Doctrine\Common\Annotations\AnnotationReader;
1515
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
@@ -19,8 +19,16 @@ abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase
1919
{
2020
protected function setUp()
2121
{
22-
if (!class_exists('Doctrine\\Common\\Version')) {
23-
$this->markTestSkipped('Doctrine is not available.');
22+
if (!class_exists('Doctrine\Common\Version')) {
23+
$this->markTestSkipped('Doctrine Common is not available.');
24+
}
25+
26+
if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) {
27+
$this->markTestSkipped('Doctrine DBAL is not available.');
28+
}
29+
30+
if (!class_exists('Doctrine\ORM\EntityManager')) {
31+
$this->markTestSkipped('Doctrine ORM is not available.');
2432
}
2533
}
2634

@@ -33,7 +41,7 @@ static public function createTestEntityManager($paths = array())
3341
self::markTestSkipped('This test requires SQLite support in your environment');
3442
}
3543
$config = new \Doctrine\ORM\Configuration();
36-
$config->setEntityNamespaces(array('SymfonyTestsDoctrine' => 'Symfony\Tests\Bridge\Doctrine\Fixtures'));
44+
$config->setEntityNamespaces(array('SymfonyTestsDoctrine' => 'Symfony\Bridge\Doctrine\Tests\Fixtures'));
3745
$config->setAutoGenerateProxyClasses(true);
3846
$config->setProxyDir(\sys_get_temp_dir());
3947
$config->setProxyNamespace('SymfonyTests\Doctrine');

‎tests/Symfony/Tests/Bridge/Doctrine/Fixtures/AssociationEntity.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/Fixtures/AssociationEntity.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Fixtures/AssociationEntity.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Symfony\Tests\Bridge\Doctrine\Fixtures;
3+
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;
44

55
use Doctrine\ORM\Mapping AS ORM;
66

@@ -18,7 +18,7 @@ class AssociationEntity
1818

1919
/**
2020
* @ORM\ManyToOne(targetEntity="SingleIdentEntity")
21-
* @var \Symfony\Tests\Bridge\Doctrine\Form\Fixtures\SingleIdentEntity
21+
* @var \Symfony\Bridge\Doctrine\Tests\Form\Fixtures\SingleIdentEntity
2222
*/
2323
public $single;
2424

@@ -28,7 +28,7 @@ class AssociationEntity
2828
* @ORM\JoinColumn(name="composite_id1", referencedColumnName="id1"),
2929
* @ORM\JoinColumn(name="composite_id2", referencedColumnName="id2")
3030
* })
31-
* @var \Symfony\Tests\Bridge\Doctrine\Form\Fixtures\CompositeIdentEntity
31+
* @var \Symfony\Bridge\Doctrine\Tests\Form\Fixtures\CompositeIdentEntity
3232
*/
3333
public $composite;
3434
}

‎tests/Symfony/Tests/Bridge/Doctrine/Fixtures/CompositeIdentEntity.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeIdentEntity.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeIdentEntity.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Symfony\Tests\Bridge\Doctrine\Fixtures;
3+
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;
44

55
use Doctrine\ORM\Mapping\Id;
66
use Doctrine\ORM\Mapping\Column;

‎tests/Symfony/Tests/Bridge/Doctrine/Fixtures/CompositeStringIdentEntity.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeStringIdentEntity.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeStringIdentEntity.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Symfony\Tests\Bridge\Doctrine\Fixtures;
3+
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;
44

55
use Doctrine\ORM\Mapping\Id;
66
use Doctrine\ORM\Mapping\Column;

‎tests/Symfony/Tests/Bridge/Doctrine/Fixtures/ContainerAwareFixture.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/Fixtures/ContainerAwareFixture.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Fixtures/ContainerAwareFixture.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Symfony\Tests\Bridge\Doctrine\Fixtures;
3+
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;
44

55
use Doctrine\Common\DataFixtures\FixtureInterface;
66
use Doctrine\Common\Persistence\ObjectManager;

‎tests/Symfony/Tests/Bridge/Doctrine/Fixtures/ItemGroupEntity.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/Fixtures/ItemGroupEntity.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Fixtures/ItemGroupEntity.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Symfony\Tests\Bridge\Doctrine\Fixtures;
3+
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;
44

55
use Doctrine\ORM\Mapping\Id;
66
use Doctrine\ORM\Mapping\Column;

‎tests/Symfony/Tests/Bridge/Doctrine/Fixtures/NoToStringSingleIdentEntity.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/Fixtures/NoToStringSingleIdentEntity.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Fixtures/NoToStringSingleIdentEntity.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Symfony\Tests\Bridge\Doctrine\Fixtures;
3+
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;
44

55
use Doctrine\ORM\Mapping\Id;
66
use Doctrine\ORM\Mapping\Column;

‎tests/Symfony/Tests/Bridge/Doctrine/Fixtures/SingleIdentEntity.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIdentEntity.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIdentEntity.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Symfony\Tests\Bridge\Doctrine\Fixtures;
3+
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;
44

55
use Doctrine\ORM\Mapping\Id;
66
use Doctrine\ORM\Mapping\Column;

‎tests/Symfony/Tests/Bridge/Doctrine/Fixtures/SingleStringIdentEntity.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringIdentEntity.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringIdentEntity.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Symfony\Tests\Bridge\Doctrine\Fixtures;
3+
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;
44

55
use Doctrine\ORM\Mapping\Id;
66
use Doctrine\ORM\Mapping\Column;

‎tests/Symfony/Tests/Bridge/Doctrine/Form/ChoiceList/EntityChoiceListTest.php renamed to ‎src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php
+13-14Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,31 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Tests\Bridge\Doctrine\Form\ChoiceList;
12+
namespace Symfony\Bridge\Doctrine\Tests\Form\ChoiceList;
1313

14-
require_once __DIR__.'/../../DoctrineOrmTestCase.php';
15-
require_once __DIR__.'/../../Fixtures/ItemGroupEntity.php';
16-
require_once __DIR__.'/../../Fixtures/SingleIdentEntity.php';
17-
require_once __DIR__.'/../../Fixtures/NoToStringSingleIdentEntity.php';
18-
19-
use Symfony\Tests\Bridge\Doctrine\DoctrineOrmTestCase;
20-
use Symfony\Tests\Bridge\Doctrine\Fixtures\ItemGroupEntity;
21-
use Symfony\Tests\Bridge\Doctrine\Fixtures\SingleIdentEntity;
22-
use Symfony\Tests\Bridge\Doctrine\Fixtures\NoToStringSingleIdentEntity;
14+
use Symfony\Bridge\Doctrine\Tests\DoctrineOrmTestCase;
15+
use Symfony\Bridge\Doctrine\Tests\Fixtures\ItemGroupEntity;
16+
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity;
17+
use Symfony\Bridge\Doctrine\Tests\Fixtures\NoToStringSingleIdentEntity;
2318
use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList;
2419
use Symfony\Component\Form\Extension\Core\View\ChoiceView;
2520

2621
class EntityChoiceListTest extends DoctrineOrmTestCase
2722
{
28-
const ITEM_GROUP_CLASS = 'Symfony\Tests\Bridge\Doctrine\Fixtures\ItemGroupEntity';
23+
const ITEM_GROUP_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\ItemGroupEntity';
2924

30-
const SINGLE_IDENT_CLASS = 'Symfony\Tests\Bridge\Doctrine\Fixtures\SingleIdentEntity';
25+
const SINGLE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity';
3126

32-
const COMPOSITE_IDENT_CLASS = 'Symfony\Tests\Bridge\Doctrine\Fixtures\CompositeIdentEntity';
27+
const COMPOSITE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity';
3328

3429
private $em;
3530

3631
protected function setUp()
3732
{
33+
if (!class_exists('Symfony\Component\Form\Form')) {
34+
$this->markTestSkipped('The "Form" component is not available');
35+
}
36+
3837
parent::setUp();
3938

4039
$this->em = $this->createTestEntityManager();
@@ -49,7 +48,7 @@ protected function tearDown()
4948

5049
/**
5150
* @expectedException Symfony\Component\Form\Exception\FormException
52-
* @expectedMessage Entity "Symfony\Tests\Bridge\Doctrine\Fixtures\SingleIdentEntity" passed to the choice field must have a "__toString()" method defined (or you can also override the "property" option).
51+
* @expectedMessage Entity "Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity" passed to the choice field must have a "__toString()" method defined (or you can also override the "property" option).
5352
*/
5453
public function testEntitesMustHaveAToStringMethod()
5554
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.