|
3 | 3 | namespace Hackzilla\Bundle\TicketBundle\Tests\Functional; |
4 | 4 |
|
5 | 5 | use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; |
| 6 | +use FOS\UserBundle\FOSUserBundle; |
6 | 7 | use Hackzilla\Bundle\TicketBundle\HackzillaTicketBundle; |
7 | 8 | use Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity\User; |
8 | 9 | use Knp\Bundle\PaginatorBundle\KnpPaginatorBundle; |
@@ -41,6 +42,7 @@ public function registerBundles() |
41 | 42 | new FrameworkBundle(), |
42 | 43 | new SecurityBundle(), |
43 | 44 | new DoctrineBundle(), |
| 45 | + new FOSUserBundle(), |
44 | 46 | new KnpPaginatorBundle(), |
45 | 47 | new TwigBundle(), |
46 | 48 | new HackzillaTicketBundle(), |
@@ -96,11 +98,20 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load |
96 | 98 | $c->loadFromExtension('framework', [ |
97 | 99 | 'secret' => 'MySecretKey', |
98 | 100 | 'default_locale' => 'en', |
| 101 | + 'session' => [ |
| 102 | + 'handler_id' => 'session.handler.native_file', |
| 103 | + 'storage_id' => 'session.storage.mock_file', |
| 104 | + 'name' => 'MOCKSESSID', |
| 105 | + ], |
99 | 106 | 'translator' => [ |
100 | 107 | 'fallbacks' => [ |
101 | 108 | 'en', |
102 | 109 | ], |
103 | 110 | ], |
| 111 | + 'form' => null, |
| 112 | + 'validation' => [ |
| 113 | + 'enabled' => true, |
| 114 | + ], |
104 | 115 | ]); |
105 | 116 |
|
106 | 117 | // SecurityBundle config |
@@ -131,34 +142,51 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load |
131 | 142 | ], |
132 | 143 | 'orm' => [ |
133 | 144 | 'default_entity_manager' => 'default', |
| 145 | + 'auto_mapping' => true, |
| 146 | + 'mappings' => [ |
| 147 | + 'HackzillaTicketBundle' => [ |
| 148 | + 'dir' => __DIR__.'/Entity', |
| 149 | + 'prefix' => 'Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity', |
| 150 | + 'alias' => 'HackzillaTicketBundle', |
| 151 | + 'type' => 'annotation', |
| 152 | + ], |
| 153 | + ], |
134 | 154 | ], |
135 | 155 | ]); |
136 | 156 |
|
137 | 157 | // TwigBundle config |
138 | 158 | $twigConfig = [ |
139 | | - 'strict_variables' => '%kernel.debug%', |
140 | | - 'autoescape' => 'name', |
| 159 | + 'strict_variables' => '%kernel.debug%', |
| 160 | + 'exception_controller' => null, |
| 161 | + 'autoescape' => 'name', |
141 | 162 | ]; |
142 | 163 | // "default_path" configuration is available since version 3.4. |
143 | 164 | if (version_compare(self::VERSION, '3.4', '>=')) { |
144 | 165 | $twigConfig['default_path'] = __DIR__.'/Resources/views'; |
145 | 166 | } |
146 | 167 | $c->loadFromExtension('twig', $twigConfig); |
147 | 168 |
|
| 169 | + // FOSUserBundle config |
| 170 | + $c->loadFromExtension('fos_user', [ |
| 171 | + 'user_class' => User::class, |
| 172 | + 'db_driver' => 'orm', |
| 173 | + 'firewall_name' => 'api', |
| 174 | + 'from_email' => [ |
| 175 | + |
| 176 | + 'sender_name' => 'HackzillaTicketBundle', |
| 177 | + ], |
| 178 | + 'service' => [ |
| 179 | + 'mailer' => 'fos_user.mailer.noop', |
| 180 | + ], |
| 181 | + ]); |
| 182 | + |
148 | 183 | // HackzillaBundle config |
149 | 184 | $c->loadFromExtension('hackzilla_ticket', [ |
150 | 185 | 'user_class' => User::class, |
151 | 186 | 'translation_domain' => 'HackzillaTicketBundle', |
152 | 187 | ]); |
153 | 188 |
|
154 | 189 | if ($this->useVichUploaderBundle) { |
155 | | - // FrameworkBundle config |
156 | | - // "framework.form" is required since "vich_uploader.namer_directory_property" |
157 | | - // service uses "form.property_accessor" service. |
158 | | - $c->loadFromExtension('framework', [ |
159 | | - 'form' => null, |
160 | | - ]); |
161 | | - |
162 | 190 | // VichUploaderBundle config |
163 | 191 | $c->loadFromExtension('vich_uploader', [ |
164 | 192 | 'db_driver' => 'orm', |
|
0 commit comments