Zend Session Handler Db handler crashes during PHPUnit test

I did unit testing and I ran into this weird bad issue.

I am performing user authentication tests with some of my services / mappers.

Now I run about 307 tests. This only happens when I run them all in one batch.

I am trying to instantiate only one Zend_Application object and use it for all my tests. I am only creating an instance to take care of db connection, session and autoload of my classes.

Here is the problem.

Somewhere along the test line, the __destruct method for Zend_Session_SaveHandler_DbTable is called. I have no idea why? But it is so.

The __destruct method will make any entry for my session objects useless, as they are marked as read-only.

I have no idea why the destruct method is being called.

He gets a lot of tests before my authentications. If I run each test folder separately, there is no problem. This is only when I try to run all 307 tests. I have some tests that work with a database, but my code does not close the db connections or break the save handler.

Does anyone have any ideas on why this is happening and why my Zend_Session_SaveHandler_DbTable is crashing? Does this have anything to do with the default lifetime?

+3
source share
2 answers

, , PHPUnit . , 307, , - , , Zend_Session_SaveHandler_DbTable.

, , .

, , PHP, , .

, Zend_Application , zend_application .

.

__destruct save.

(X + 1) , X , . 50 , 51 , 307 , 308 ..

. , . 307 , 90 - , , 90 . - . - X + 1, 308.

, , - tearDown, PHPUnit, PHP. , PHPUnit . , , , .

- , . , , phpunit zend, , .

+1

, , . , .

Zend_Session::$_unitTestEnabled = true;
+1

All Articles