Everytime a new request is made with sfTestFunctional, a new sfEventDispatcher is created. I'm trying to test that an event is fired when certain data is posted.
here's the test: ---- $listener = new Listener(); sfContext::getInstance()->getEventDispatcher()->connect('user.register', array($listener, 'listenToRegister')); echo "listener attached\n"; $browser-> click('Register', array('user' => array( 'username' => 'dave', 'email' => 'd...@dave.com', 'password' => 'dave', 'password1' => 'dave', 'height' => 164, 'gender' => 'male', )), array('method' => 'post')); $browser-> test()-> ok($listener->getEvent() instanceof sfEvent); --- I've added an echo statement to the contructor of sfEventDispatcher to make the output more reasable: ok 10 - response selector form exists listener attached # post /signup creating dispatcher! not ok 11 # Failed test (./test/functional/frontend/mainActionsTest.php at line 82) notice that the test code's connect() call is made, but... the sfEventDispatcher is re-instanced due to the click() method on sfBrowser creating a new request, and hence a new dispatcher. Any ideas? -- Blog: http://pookey.co.uk/blog Follow me on twitter: http://twitter.com/ipchristian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---