| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * This file is part of the PierstovalCharacterManagerBundle package. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * (c) Alexandre Rock Ancelet <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * For the full copyright and license information, please view the LICENSE | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  * file that was distributed with this source code. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | namespace Pierstoval\Bundle\CharacterManagerBundle\Tests\Controller; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | use Tests\WebTestCase as PiersTestCase; | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 16 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 17 |  |  | class MultipleManagersGeneratorControllerFunctionalTest extends WebTestCase | 
            
                                                        
            
                                    
            
            
                | 18 |  |  | { | 
            
                                                        
            
                                    
            
            
                | 19 |  |  |     use PiersTestCase; | 
            
                                                        
            
                                    
            
            
                | 20 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 21 |  |  |     protected static function createKernel(array $options = []) | 
            
                                                        
            
                                    
            
            
                | 22 |  |  |     { | 
            
                                                        
            
                                    
            
            
                | 23 |  |  |         $options['environment'] = 'test_more_managers'; | 
            
                                                        
            
                                    
            
            
                | 24 |  |  |         return parent::createKernel($options); | 
            
                                                        
            
                                    
            
            
                | 25 |  |  |     } | 
            
                                                        
            
                                    
            
            
                | 26 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 27 |  |  |     public function test main generate redirects to first step() | 
            
                                                        
            
                                    
            
            
                | 28 |  |  |     { | 
            
                                                        
            
                                    
            
            
                | 29 |  |  |         $client = $this->getClient(); | 
            
                                                        
            
                                    
            
            
                | 30 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 31 |  |  |         $client->getKernel()->boot(); | 
            
                                                        
            
                                    
            
            
                | 32 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 33 |  |  |         $client->request('GET', '/main/generate'); | 
            
                                                        
            
                                    
            
            
                | 34 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 35 |  |  |         static::assertSame(302, $client->getResponse()->getStatusCode()); | 
            
                                                        
            
                                    
            
            
                | 36 |  |  |         static::assertSame('/main/generate/step_01', $client->getResponse()->headers->get('Location')); | 
            
                                                        
            
                                    
            
            
                | 37 |  |  |     } | 
            
                                                        
            
                                    
            
            
                | 38 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 39 |  |  |     public function test other generate redirects to first step() | 
            
                                                        
            
                                    
            
            
                | 40 |  |  |     { | 
            
                                                        
            
                                    
            
            
                | 41 |  |  |         $client = $this->getClient(); | 
            
                                                        
            
                                    
            
            
                | 42 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 43 |  |  |         $client->getKernel()->boot(); | 
            
                                                        
            
                                    
            
            
                | 44 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 45 |  |  |         $client->request('GET', '/other/generate'); | 
            
                                                        
            
                                    
            
            
                | 46 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 47 |  |  |         static::assertSame(302, $client->getResponse()->getStatusCode()); | 
            
                                                        
            
                                    
            
            
                | 48 |  |  |         static::assertSame('/other/generate/step_01', $client->getResponse()->headers->get('Location')); | 
            
                                                        
            
                                    
            
            
                | 49 |  |  |     } | 
            
                                                        
            
                                    
            
            
                | 50 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 51 |  |  |  |