From 9b8cdabf1620cfd2a2af3cbd44672de5f24f2709 Mon Sep 17 00:00:00 2001 From: Drak Date: Fri, 16 Dec 2011 16:37:21 +0545 Subject: [PATCH] [FrameworkBundle] Prove client insulation and non-insulation works in session tests. --- .../Tests/Functional/SessionTest.php | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php index b536b558b8d1..7bf591b7a62f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php @@ -17,12 +17,16 @@ class SessionTest extends WebTestCase { /** + * Tests session attributes persist. + * * @dataProvider getConfigs */ - public function testWelcome($config) + public function testWelcome($config, $insulate) { $client = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); - $client->insulate(); + if ($insulate) { + $client->insulate(); + } // no session $crawler = $client->request('GET', '/session'); @@ -46,12 +50,16 @@ public function testWelcome($config) } /** + * Tests flash messages work in practice. + * * @dataProvider getConfigs */ - public function testFlash($config) + public function testFlash($config, $insulate) { $client = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); - $client->insulate(); + if ($insulate) { + $client->insulate(); + } // set flash $crawler = $client->request('GET', '/session_setflash/Hello%20world.'); @@ -70,15 +78,19 @@ public function testFlash($config) * * @dataProvider getConfigs */ - public function testTwoClients($config) + public function testTwoClients($config, $insulate) { // start first client $client1 = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); - $client1->insulate(); + if ($insulate) { + $client1->insulate(); + } // start second client $client2 = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); - $client2->insulate(); + if ($insulate) { + $client2->insulate(); + } // new session, so no name set. $crawler1 = $client1->request('GET', '/session'); @@ -120,7 +132,9 @@ public function testTwoClients($config) public function getConfigs() { return array( - array('config.yml'), + // configfile, insulate + array('config.yml', true), + array('config.yml', false), ); }