Hi Dev-ers

I have extended the sfPDOSessionStorage with encryption functionality
for the session data in my sfPDOSecureSessionStorage class. This is
working fine in my browsers, but I wanted to add a unit test to secure
this.

I simply copied the original unit-test from the sfPDOSessionStorage-
class and modified it to fit my secure sfPDOSecureSessionStorage-
class. However I cannot seem to run the unit-test. It does not seem to
be related to my secure-session-class, but more probably due to the
session_set_save_handler that seems to create two instances of the
sfPDOSessionStorage. One for sessionOpen, the other for sessionWrite.

How is the sfPDOSessionStorageTest been run before a new symfony
version is released?
I run
symfony test:unit sfPDOSecureSessionStorage

but it tells me
/symfony test:unit sfPDOSecureSessionStorage
1..15
ok 1 - sfPDOSecureSessionStorage is an instance of sfStorage
ok 2 - sfPDOSecureSessionStorage is an instance of
sfDatabaseSessionStorage

Fatal error: Call to a member function prepare() on a non-object in /
home/leree/workspace/mijnoverheid-symfony/lib/symfony/lib/storage/
sfPDOSessionStorage.class.php on line 162

Call Stack:
    0.0003      60604   1. {main}() /home/leree/workspace/mijnoverheid-
symfony/symfony:0
    0.0047     307676   2. include('/home/leree/workspace/mijnoverheid-
symfony/lib/symfony/lib/command/cli.php') /home/leree/workspace/
mijnoverheid-symfony/symfony:14
    0.2310    4728120   3. sfSymfonyCommandApplication->run() /home/
leree/workspace/mijnoverheid-symfony/lib/symfony/lib/command/cli.php:
20
    0.2398    4892204   4. sfTask->runFromCLI() /home/leree/workspace/
mijnoverheid-symfony/lib/symfony/lib/command/
sfSymfonyCommandApplication.class.php:72
    0.2399    4892204   5. sfBaseTask->doRun() /home/leree/workspace/
mijnoverheid-symfony/lib/symfony/lib/task/sfTask.class.php:75
    0.4838    4935972   6. sfTestUnitTask->execute() /home/leree/
workspace/mijnoverheid-symfony/lib/symfony/lib/task/
sfBaseTask.class.php:62
    0.4875    4971296   7. include('/home/leree/workspace/mijnoverheid-
symfony/test/unit/sfPDOSecureSessionStorageTest.php') /home/leree/
workspace/mijnoverheid-symfony/lib/symfony/lib/task/test/
sfTestUnitTask.class.php:64
    0.5919    8600344   8. sfPDOSecureSessionStorage->sessionWrite() /
home/leree/workspace/mijnoverheid-symfony/test/unit/
sfPDOSecureSessionStorageTest.php:29
    0.5926    8600344   9. sfPDOSessionStorage->sessionWrite() /home/
leree/workspace/mijnoverheid-symfony/lib/storage/
sfPDOSecureSessionStorage.class.php:141

 Looks like you planned 15 tests but only ran
2.


I can only explain this with the assumption that
session_set_save_handler creates two instances, one for the
sessionOpen-event where $db gets instantiated, and the second for the
sessionWrite-event where $db is used to call the prepare statement,
but since this is a new instance, the sessionOpen has never been
executed for this instance which explains why $db is a non-object.

As said in my browser everything works out OK, but the unit test seems
to be impossible. So can anyone tell me what goes wrong or how I can
fix this. I assume this unit test has run everytime before Symfony
gets released...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to