Last active
August 29, 2015 14:02
-
-
Save Chrysweel/b001e83d6e3c7e936f11 to your computer and use it in GitHub Desktop.
Revisions
-
Chrysweel revised this gist
Jun 6, 2014 . 1 changed file with 15 additions and 33 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,33 +1,15 @@ 1) Chatea\MyBundle\Tests\Controller\ChannelControllerTest::testSecurityRolesCanCreateChannelAction Invalid argument supplied for foreach() /var/www/workspace/apiChatea/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php:371 /var/www/workspace/apiChatea/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php:129 /var/www/workspace/apiChatea/app/bootstrap.php.cache:2867 /var/www/workspace/apiChatea/app/bootstrap.php.cache:2820 /var/www/workspace/apiChatea/app/bootstrap.php.cache:2944 /var/www/workspace/apiChatea/app/bootstrap.php.cache:2245 /var/www/workspace/apiChatea/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Client.php:81 /var/www/workspace/apiChatea/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Client.php:111 /var/www/workspace/apiChatea/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Client.php:330 /var/www/workspace/apiChatea/src/Chatea/MyBundle/Tests/Controller/ChannelControllerTest.php:99 /usr/share/php/PHPUnit/TextUI/Command.php:192 /usr/share/php/PHPUnit/TextUI/Command.php:130 -
Chrysweel revised this gist
Jun 6, 2014 . 1 changed file with 8 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ <?php public function postChannelsAction(Request $request) { $newChannel = null; try { $channelInitializeEvent = new ChannelInitializeEvent($this->getUser(),$request); @@ -12,14 +13,14 @@ public function postChannelsAction(Request $request) $newChannel = $this->get('api_bundle.form.handler.channel_handler')->post($request->request->all()); $response = $this->buildResourceView($newChannel, 201, 'channel_show'); $this->dispatchEvent(ApiChannelEvents::CHANNEL_CREATED_COMPLETED, new ChannelEvent($newChannel,$this->getUser(),$request,$response)); return $response; }catch (InvalidFormException $exception) { return $this->buildFormErrorsView($exception->getForm()); }catch(AbortSaveChannelException $ex){ //this exception is trowed when event channel_created_success is aborted return $this->createError($ex->getMessage(),$ex->getCode(),404); @@ -29,4 +30,4 @@ public function postChannelsAction(Request $request) } return $this->createError($ex->getMessage(),60,404); } } -
Chrysweel revised this gist
Jun 6, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ <?php public function postChannelsAction(Request $request) { $newChannel = null; -
Chrysweel renamed this gist
Jun 6, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Chrysweel created this gist
Jun 6, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ public function postChannelsAction(Request $request) { $newChannel = null; try { $channelInitializeEvent = new ChannelInitializeEvent($this->getUser(),$request); $this->dispatchEvent(ApiChannelEvents::CHANNEL_CREATED_INITIALIZE, $channelInitializeEvent); if ($channelInitializeEvent->isAborted()){ return $this->serviceError($channelInitializeEvent->getCodeMessageError(),403); } $newChannel = $this->get('api_bundle.form.handler.channel_handler')->post($request->request->all()); $response = $this->buildResourceView($newChannel, 201, 'channel_show'); $this->dispatchEvent(ApiChannelEvents::CHANNEL_CREATED_COMPLETED, new ChannelEvent($newChannel,$this->getUser(),$request,$response)); return $response; }catch (InvalidFormException $exception) { return $this->buildFormErrorsView($exception->getForm()); }catch(AbortSaveChannelException $ex){ //this exception is trowed when event channel_created_success is aborted return $this->createError($ex->getMessage(),$ex->getCode(),404); }catch(\Exception $ex){ if($newChannel != null){ $this->get('chatea_api.manager.channel.default')->delete($newChannel); } return $this->createError($ex->getMessage(),60,404); } }