Skip to content

Cleanup Some Tests - tearDown and namespaces #5737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2012

Conversation

dpb587
Copy link
Contributor

@dpb587 dpb587 commented Oct 13, 2012

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: ~

@pborreli
Copy link
Contributor

from PHPUnit documentation :

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.

@fabpot
Copy link
Member

fabpot commented Oct 13, 2012

All these tearDown methods are not needed and should be removed.

fabpot added a commit that referenced this pull request Oct 14, 2012
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.
@fabpot fabpot merged commit 3d2a7db into symfony:master Oct 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants