Skip to content

[HttpKernel] Ensure the storage exists before purging it in ProfilerTest #11321

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
Jul 6, 2014

Conversation

penyaskito
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #11319
License MIT
Doc PR None

@@ -79,8 +79,10 @@ protected function setUp()

protected function tearDown()
{
$this->storage->purge();
$this->storage = null;
if ($this->storage !== null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Symfony code we usually opt for Yoda conditions, so this line should be:

if (null !== $this->storage) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, fixed it! Thanks @javiereguiluz

@dawehner
Copy link
Contributor

dawehner commented Jul 5, 2014

Would it be possible to write a test for that?

if (null !== $this->storage) {
$this->storage->purge();
$this->storage = null;
}

@unlink($this->tmp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be skipped as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to the same if block, not sure if it should be a separate one.

@Tobion
Copy link
Contributor

Tobion commented Jul 5, 2014

@dawehner this is already a test. You don't write tests for tests. ^^

@Tobion
Copy link
Contributor

Tobion commented Jul 5, 2014

👍

1 similar comment
@fabpot
Copy link
Member

fabpot commented Jul 6, 2014

👍

@fabpot
Copy link
Member

fabpot commented Jul 6, 2014

Thank you @penyaskito.

@fabpot fabpot merged commit eb63270 into symfony:2.3 Jul 6, 2014
fabpot added a commit that referenced this pull request Jul 6, 2014
… in ProfilerTest (penyaskito)

This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] Ensure the storage exists before purging it in ProfilerTest

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11319
| License       | MIT
| Doc PR        | None

Commits
-------

eb63270 bug #11319 [HttpKernel] Ensure the storage exists before purging it in ProfilerTest
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.

5 participants