Skip to content

Commit

Permalink
merged branch dpb587/pr-cleanup-some-tests (PR symfony#5737)
Browse files Browse the repository at this point in the history
This PR was merged into the master branch.

Commits
-------

3d2a7db Fix a few namespaces to match file system.

Discussion
----------

Cleanup Some Tests - tearDown and namespaces

Tried to cleanup a few tests and fix a few test classes which weren't following PSR-0. Removed original `tearDown` changes.

---

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: ~
Todo: ~
License of the code: MIT
Documentation PR: ~

---------------------------------------------------------------------------

by pborreli at 2012-10-13T06:41:14Z

from [PHPUnit documentation](http://www.phpunit.de/manual/current/en/fixtures.html#fixtures.more-setup-than-teardown) :

>setUp() and tearDown() are nicely symmetrical in theory but not in practice. In practice, you only need to implement tearDown() if you have allocated external resources like files or sockets in setUp(). If your setUp() just creates plain PHP objects, you can generally ignore tearDown(). However, if you create many objects in your setUp(), you might want to unset() the variables pointing to those objects in your tearDown() so they can be garbage collected. The garbage collection of test case objects is not predictable.

---------------------------------------------------------------------------

by fabpot at 2012-10-13T10:05:49Z

All these tearDown methods are not needed and should be removed.
  • Loading branch information
fabpot committed Oct 14, 2012
2 parents 875e0e2 + 3d2a7db commit 5f5b1dc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Symfony\Bridge\Doctrine\HttpFoundation;
namespace Symfony\Bridge\Doctrine\Tests\HttpFoundation;

use Symfony\Bridge\Doctrine\HttpFoundation\DbalSessionHandler;

Expand Down
4 changes: 3 additions & 1 deletion src/Symfony/Component/Form/Tests/FormRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
* file that was distributed with this source code.
*/

namespace Symfony\Component\Form;
namespace Symfony\Component\Form\Tests;

use Symfony\Component\Form\FormRegistry;
use Symfony\Component\Form\FormTypeGuesserChain;
use Symfony\Component\Form\Tests\Fixtures\TestExtension;
use Symfony\Component\Form\Tests\Fixtures\FooSubTypeWithParentInstance;
use Symfony\Component\Form\Tests\Fixtures\FooSubType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Symfony\Component\HttpFoundation\Tests;
namespace Symfony\Component\HttpFoundation\Tests\Session\Attribute;

use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag;

Expand Down

0 comments on commit 5f5b1dc

Please sign in to comment.