Skip to content
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

teardown() is called twice #266

Closed
forrest79 opened this issue Oct 22, 2015 · 4 comments
Closed

teardown() is called twice #266

forrest79 opened this issue Oct 22, 2015 · 4 comments
Labels
bug

Comments

@forrest79
Copy link
Contributor

@forrest79 forrest79 commented Oct 22, 2015

In version 1.6 we have this problem. Our DB abstraction has some of the following code (simplified):

$resource = @pg_query_params($this->getResource(), $sql, $variables);

if (is_resource($resource) === FALSE) {
    throw new Database\QueryException('Database query failed. ' . $this->getLastError());
}

For our DB tests, we begin transaction in setUp() and we rollback it in tearDown(). If we want to test some QueryException via Assert::exception(...), in Tester 1.6 is called tearDown before generating our QueryExceptionm because @pg_query_params generate WARNING or NOTICE (which is suppressed by @) and this called new $errorHandler from Framework/TestCase.php line 109. This close transaction in our code and I get bad error message (because I don't have last error...) and after that is called tearDown properly from line 143.

@milo

This comment has been minimized.

Copy link
Member

@milo milo commented Oct 22, 2015

@forrest79 If you can, could you try #267 cf756cf?

@milo milo closed this in cf756cf Oct 23, 2015
@jiripudil

This comment has been minimized.

Copy link
Contributor

@jiripudil jiripudil commented Oct 24, 2015

@milo 👍 could this fix make it into a tagged stable release anytime soon?

@milo

This comment has been minimized.

Copy link
Member

@milo milo commented Oct 26, 2015

@jiripudil @forrest79 Released 1.6.1

@forrest79

This comment has been minimized.

Copy link
Contributor Author

@forrest79 forrest79 commented Oct 29, 2015

Works good, thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.