@@ -21,10 +21,10 @@ |
||
| 21 | 21 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 22 | 22 | { |
| 23 | 23 | $builder |
| 24 | - ->add('name','text',[ |
|
| 24 | + ->add('name', 'text', [ |
|
| 25 | 25 | "label"=>"Nom de l'image" |
| 26 | 26 | ]) |
| 27 | - ->add('file','text',[ |
|
| 27 | + ->add('file', 'text', [ |
|
| 28 | 28 | "label"=>"Chemin de l'image" |
| 29 | 29 | ]) |
| 30 | 30 | ; |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 16 | 16 | { |
| 17 | 17 | $builder |
| 18 | - ->add('fileData','file') |
|
| 18 | + ->add('fileData', 'file') |
|
| 19 | 19 | ; |
| 20 | 20 | } |
| 21 | 21 | |
@@ -26,24 +26,24 @@ discard block |
||
| 26 | 26 | * @param $editor |
| 27 | 27 | * @return \Symfony\Component\HttpFoundation\Response |
| 28 | 28 | */ |
| 29 | - public function indexAction( $model, $bundle, $model_id, $editor ) |
|
| 29 | + public function indexAction($model, $bundle, $model_id, $editor) |
|
| 30 | 30 | { |
| 31 | 31 | $params = [ |
| 32 | 32 | 'medias'=>$this->get('mk.media.manager')->findMediasByModelAndId($model, $model_id), |
| 33 | 33 | 'entity'=>$this->getManage()->getRepository("$bundle:$model")->find($model_id), |
| 34 | - 'mode'=>$editor=='true' ? $editor : null, |
|
| 35 | - 'url'=>$editor == "true" ? ['model'=>$model,'bundle'=>$bundle,'model_id'=>$model_id,'mode'=>'true'] : ['model'=>$model,'bundle'=>$bundle,'model_id'=>$model_id] |
|
| 34 | + 'mode'=>$editor == 'true' ? $editor : null, |
|
| 35 | + 'url'=>$editor == "true" ? ['model'=>$model, 'bundle'=>$bundle, 'model_id'=>$model_id, 'mode'=>'true'] : ['model'=>$model, 'bundle'=>$bundle, 'model_id'=>$model_id] |
|
| 36 | 36 | ]; |
| 37 | 37 | $form = $this->createForm( |
| 38 | 38 | new MediaType(), |
| 39 | 39 | new Media, |
| 40 | 40 | [ |
| 41 | - 'action' => $this->generateUrl('mykees_media_add',$params['url']), |
|
| 41 | + 'action' => $this->generateUrl('mykees_media_add', $params['url']), |
|
| 42 | 42 | 'method' => 'POST', |
| 43 | 43 | ] |
| 44 | 44 | ); |
| 45 | 45 | |
| 46 | - return $this->render('MykeesMediaBundle:Media:index.html.twig',[ |
|
| 46 | + return $this->render('MykeesMediaBundle:Media:index.html.twig', [ |
|
| 47 | 47 | 'form'=>$form->createView(), |
| 48 | 48 | 'model'=>$model, |
| 49 | 49 | 'bundle'=> $bundle, |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * @throws \Exception |
| 59 | 59 | * @return \Symfony\Component\HttpFoundation\Response |
| 60 | 60 | */ |
| 61 | - public function addAction( Request $request ) |
|
| 61 | + public function addAction(Request $request) |
|
| 62 | 62 | { |
| 63 | 63 | $requestArray = [ |
| 64 | 64 | 'file'=>$request->files, |
@@ -68,24 +68,24 @@ discard block |
||
| 68 | 68 | $bundle = $request->get('bundle'); |
| 69 | 69 | $model_id = $request->get('model_id'); |
| 70 | 70 | |
| 71 | - if( $request->isXmlHttpRequest() && $requestArray['file'] ) |
|
| 71 | + if ($request->isXmlHttpRequest() && $requestArray['file']) |
|
| 72 | 72 | { |
| 73 | 73 | //Init Event |
| 74 | - $event = $this->initEvent($requestArray['file'],$model,$model_id); |
|
| 74 | + $event = $this->initEvent($requestArray['file'], $model, $model_id); |
|
| 75 | 75 | |
| 76 | - if($event->getMedia()) |
|
| 76 | + if ($event->getMedia()) |
|
| 77 | 77 | { |
| 78 | 78 | $requestArray['entity'] = $this->getManage()->getRepository("$bundle:$model")->find($model_id); |
| 79 | 79 | |
| 80 | 80 | |
| 81 | - return $this->render('MykeesMediaBundle:Media:upload/upload_list.html.twig',[ |
|
| 81 | + return $this->render('MykeesMediaBundle:Media:upload/upload_list.html.twig', [ |
|
| 82 | 82 | 'params'=>$requestArray, |
| 83 | 83 | 'media'=>$event->getMedia(), |
| 84 | 84 | 'model'=>$model, |
| 85 | 85 | 'bundle'=>$bundle, |
| 86 | 86 | 'model_id'=>$model_id |
| 87 | 87 | ]); |
| 88 | - }else{ |
|
| 88 | + }else { |
|
| 89 | 89 | $response = new Response(); |
| 90 | 90 | $response->setContent(json_encode(array( |
| 91 | 91 | 'error'=>"Le format n'est pas valid" |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - private function initEvent($file,$model,$model_id) |
|
| 100 | + private function initEvent($file, $model, $model_id) |
|
| 101 | 101 | { |
| 102 | 102 | $event = new UploadEvent(); |
| 103 | 103 | $event->setFile($file); |
@@ -120,10 +120,10 @@ discard block |
||
| 120 | 120 | * @param Request $request |
| 121 | 121 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
| 122 | 122 | */ |
| 123 | - public function thumbAction( $model, $bundle, $model_id, $id, Request $request ) |
|
| 123 | + public function thumbAction($model, $bundle, $model_id, $id, Request $request) |
|
| 124 | 124 | { |
| 125 | - $media = $this->getManage()->getRepository("MykeesMediaBundle:Media")->find($id); |
|
| 126 | - $entity = $this->getManage()->getRepository("$bundle:$model")->find($model_id); |
|
| 125 | + $media = $this->getManage()->getRepository("MykeesMediaBundle:Media")->find($id); |
|
| 126 | + $entity = $this->getManage()->getRepository("$bundle:$model")->find($model_id); |
|
| 127 | 127 | $entity->setThumb($media); |
| 128 | 128 | $this->getManage()->persist($entity); |
| 129 | 129 | $this->getManage()->flush(); |
@@ -138,16 +138,16 @@ discard block |
||
| 138 | 138 | * @param Request $request |
| 139 | 139 | * @return Response |
| 140 | 140 | */ |
| 141 | - public function showAction( $model=null, $id = null, Request $request ) |
|
| 141 | + public function showAction($model = null, $id = null, Request $request) |
|
| 142 | 142 | { |
| 143 | - if( !$id ) |
|
| 143 | + if (!$id) |
|
| 144 | 144 | { |
| 145 | 145 | $params = [ |
| 146 | 146 | 'class'=>$request->get('class'), |
| 147 | 147 | 'alt'=>$request->get('alt') |
| 148 | 148 | ]; |
| 149 | - $params['media'] = $this->getManage()->getRepository('MykeesMediaBundle:Media')->findOneBy(['name'=>$params['alt'],'model'=>$model]); |
|
| 150 | - }else{ |
|
| 149 | + $params['media'] = $this->getManage()->getRepository('MykeesMediaBundle:Media')->findOneBy(['name'=>$params['alt'], 'model'=>$model]); |
|
| 150 | + }else { |
|
| 151 | 151 | $params = [ |
| 152 | 152 | 'media'=>$this->getManage()->getRepository('MykeesMediaBundle:Media')->find($id), |
| 153 | 153 | 'class'=>null |
@@ -157,18 +157,18 @@ discard block |
||
| 157 | 157 | new MediaShowType(), |
| 158 | 158 | $params['media'], |
| 159 | 159 | [ |
| 160 | - 'action' => $this->generateUrl('mykees_media_show',['model'=>$model,'id'=>$id]), |
|
| 160 | + 'action' => $this->generateUrl('mykees_media_show', ['model'=>$model, 'id'=>$id]), |
|
| 161 | 161 | 'method' => 'POST', |
| 162 | 162 | ] |
| 163 | 163 | ); |
| 164 | - if($request->getMethod() == "POST") |
|
| 164 | + if ($request->getMethod() == "POST") |
|
| 165 | 165 | { |
| 166 | 166 | $media = $request->request->all(); |
| 167 | - return $this->render('MykeesMediaBundle:Media:tinymce.html.twig',['media'=>$media]); |
|
| 167 | + return $this->render('MykeesMediaBundle:Media:tinymce.html.twig', ['media'=>$media]); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - return $this->render('MykeesMediaBundle:Media:show/show.html.twig',[ |
|
| 171 | - 'media'=>$params['media'],'form'=>$form->createView(),'class'=>$params['class'],"model"=>$model |
|
| 170 | + return $this->render('MykeesMediaBundle:Media:show/show.html.twig', [ |
|
| 171 | + 'media'=>$params['media'], 'form'=>$form->createView(), 'class'=>$params['class'], "model"=>$model |
|
| 172 | 172 | ]); |
| 173 | 173 | } |
| 174 | 174 | |
@@ -180,16 +180,16 @@ discard block |
||
| 180 | 180 | * @param $id |
| 181 | 181 | * @return Response |
| 182 | 182 | */ |
| 183 | - public function deleteAction( $model, $bundle, $id ) |
|
| 183 | + public function deleteAction($model, $bundle, $id) |
|
| 184 | 184 | { |
| 185 | - if( $id ) |
|
| 185 | + if ($id) |
|
| 186 | 186 | { |
| 187 | 187 | $media = $this->getManage()->getRepository('MykeesMediaBundle:Media')->find($id); |
| 188 | 188 | $media_manager = $this->get('mk.media.manager'); |
| 189 | - $media_manager->unlink($model,$media); |
|
| 189 | + $media_manager->unlink($model, $media); |
|
| 190 | 190 | |
| 191 | 191 | $model_referer = $this->getManage()->getRepository("$bundle:$model")->find($media->getMediableId()); |
| 192 | - if(method_exists($model_referer,'getThumb') && $model_referer->getThumb() !== null && $model_referer->getThumb()->getId() == $media->getId()) |
|
| 192 | + if (method_exists($model_referer, 'getThumb') && $model_referer->getThumb() !== null && $model_referer->getThumb()->getId() == $media->getId()) |
|
| 193 | 193 | { |
| 194 | 194 | $model_referer->setThumb(null); |
| 195 | 195 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | public $webroot; |
| 17 | 17 | |
| 18 | 18 | |
| 19 | - public function __construct(array $resize_option, $webroot){ |
|
| 19 | + public function __construct(array $resize_option, $webroot) { |
|
| 20 | 20 | $this->options = $resize_option; |
| 21 | 21 | $this->webroot = $webroot.'/img/'; |
| 22 | 22 | } |
@@ -24,23 +24,23 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public function resize($image) |
| 26 | 26 | { |
| 27 | - $absolute_path = $this->webroot . $image; |
|
| 27 | + $absolute_path = $this->webroot.$image; |
|
| 28 | 28 | $absolute_info = pathinfo($absolute_path); |
| 29 | - $allowedExtension = ['jpg','JPG','jpeg',"JPEG",'png','PNG','gif','GIF']; |
|
| 29 | + $allowedExtension = ['jpg', 'JPG', 'jpeg', "JPEG", 'png', 'PNG', 'gif', 'GIF']; |
|
| 30 | 30 | $extension = pathinfo($image); |
| 31 | 31 | $extension = $extension['extension']; |
| 32 | 32 | |
| 33 | - if(in_array($extension, $allowedExtension)) |
|
| 33 | + if (in_array($extension, $allowedExtension)) |
|
| 34 | 34 | { |
| 35 | - if(!empty($this->options)) |
|
| 35 | + if (!empty($this->options)) |
|
| 36 | 36 | { |
| 37 | - foreach($this->options['size'] as $k=>$v) |
|
| 37 | + foreach ($this->options['size'] as $k=>$v) |
|
| 38 | 38 | { |
| 39 | 39 | $width = $v['width']; |
| 40 | 40 | $height = $v['height']; |
| 41 | - $dest = $absolute_info['dirname'] . '/' . $absolute_info['filename'] . "_$width" . "x$height" . '.'.$extension; |
|
| 41 | + $dest = $absolute_info['dirname'].'/'.$absolute_info['filename']."_$width"."x$height".'.'.$extension; |
|
| 42 | 42 | |
| 43 | - if(file_exists($dest)) |
|
| 43 | + if (file_exists($dest)) |
|
| 44 | 44 | { |
| 45 | 45 | return false; |
| 46 | 46 | } |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | $imagine = new \Imagine\Gd\Imagine(); |
| 49 | 49 | $mode = $this->options['mode']; |
| 50 | 50 | |
| 51 | - $imagine->open($absolute_info['dirname'] . '/' . $absolute_info['filename'] . '.'.$extension) |
|
| 52 | - ->thumbnail(new \Imagine\Image\Box($width,$height), !empty($mode) && $mode == 'inset' ? ImageInterface::THUMBNAIL_INSET : ImageInterface::THUMBNAIL_OUTBOUND) |
|
| 51 | + $imagine->open($absolute_info['dirname'].'/'.$absolute_info['filename'].'.'.$extension) |
|
| 52 | + ->thumbnail(new \Imagine\Image\Box($width, $height), !empty($mode) && $mode == 'inset' ? ImageInterface::THUMBNAIL_INSET : ImageInterface::THUMBNAIL_OUTBOUND) |
|
| 53 | 53 | ->save($dest); |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -23,11 +23,11 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | $query = $this->_em->createQueryBuilder() |
| 25 | 25 | ->select('m') |
| 26 | - ->from($this->_entityName,'m') |
|
| 26 | + ->from($this->_entityName, 'm') |
|
| 27 | 27 | ->where('m.model = :model') |
| 28 | 28 | ->andWhere('m.modelId = :modelId') |
| 29 | - ->setParameter('model',$model) |
|
| 30 | - ->setParameter('modelId',$model_id) |
|
| 29 | + ->setParameter('model', $model) |
|
| 30 | + ->setParameter('modelId', $model_id) |
|
| 31 | 31 | ->getQuery() |
| 32 | 32 | ; |
| 33 | 33 | return $query; |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $query = $this->_em->createQueryBuilder() |
| 44 | 44 | ->select('m') |
| 45 | - ->from($this->_entityName,'m') |
|
| 45 | + ->from($this->_entityName, 'm') |
|
| 46 | 46 | ->where('m.model = :model') |
| 47 | - ->setParameter('model',$model) |
|
| 47 | + ->setParameter('model', $model) |
|
| 48 | 48 | ->getQuery() |
| 49 | 49 | ; |
| 50 | 50 | return $query; |
@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | { |
| 60 | 60 | $query = $this->_em->createQueryBuilder() |
| 61 | 61 | ->select('m') |
| 62 | - ->from($this->_entityName,'m') |
|
| 62 | + ->from($this->_entityName, 'm') |
|
| 63 | 63 | ->where('m.model IN(:model)') |
| 64 | 64 | ->andWhere('m.modelId IN(:modelId)') |
| 65 | - ->setParameter('model',array_values($model_info['models'])) |
|
| 66 | - ->setParameter('modelId',array_values($model_info['ids'])) |
|
| 65 | + ->setParameter('model', array_values($model_info['models'])) |
|
| 66 | + ->setParameter('modelId', array_values($model_info['ids'])) |
|
| 67 | 67 | ->getQuery() |
| 68 | 68 | ; |
| 69 | 69 | return $query; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @param array $model_info |
| 75 | 75 | * @return array |
| 76 | 76 | */ |
| 77 | - public function findForArrayModels(array $model_info){ |
|
| 77 | + public function findForArrayModels(array $model_info) { |
|
| 78 | 78 | return $this->queryForArray($model_info) |
| 79 | 79 | ->getResult(); |
| 80 | 80 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | public $generator; |
| 18 | 18 | |
| 19 | - public function __construct(UrlGeneratorInterface $generator ) |
|
| 19 | + public function __construct(UrlGeneratorInterface $generator) |
|
| 20 | 20 | { |
| 21 | 21 | $this->generator = $generator; |
| 22 | 22 | } |
@@ -40,21 +40,21 @@ discard block |
||
| 40 | 40 | * @param $entity |
| 41 | 41 | * @return string |
| 42 | 42 | */ |
| 43 | - public function iframeUploader(Mediable $entity ) |
|
| 43 | + public function iframeUploader(Mediable $entity) |
|
| 44 | 44 | { |
| 45 | 45 | $model = Reflection::getClassShortName($entity); |
| 46 | 46 | $model_id = $entity->getId(); |
| 47 | 47 | $bundle = Reflection::getShortBundleRepository($entity); |
| 48 | - if($model_id) |
|
| 48 | + if ($model_id) |
|
| 49 | 49 | { |
| 50 | - $url = $this->generator->generate('mykees_media',[ |
|
| 50 | + $url = $this->generator->generate('mykees_media', [ |
|
| 51 | 51 | 'model' => $model, |
| 52 | 52 | 'bundle'=> $bundle, |
| 53 | 53 | 'model_id'=> $model_id |
| 54 | 54 | ]); |
| 55 | 55 | |
| 56 | 56 | return '<iframe src="'.$url.'" style="width:100%;border: none;min-height:100%;" class="iframe-uploader"></iframe>'; |
| 57 | - }else{ |
|
| 57 | + }else { |
|
| 58 | 58 | |
| 59 | 59 | return '<h3 style="font-weight: bold;text-align: center;color:#777">The <span style="color:#DD6F6F;border-bottom:2px dashed #777;">ID</span> from your entity <span style="color:#DD6F6F;border-bottom:2px dashed #777;">'.$model.'</span> is required to use the uploader</h3>'; |
| 60 | 60 | } |
@@ -65,13 +65,13 @@ discard block |
||
| 65 | 65 | * @param $entity |
| 66 | 66 | * @return |
| 67 | 67 | */ |
| 68 | - public function wysiwygUploader( \Twig_Environment $env, Mediable $entity ) |
|
| 68 | + public function wysiwygUploader(\Twig_Environment $env, Mediable $entity) |
|
| 69 | 69 | { |
| 70 | 70 | $model = Reflection::getClassShortName($entity); |
| 71 | 71 | $model_id = $entity->getId(); |
| 72 | 72 | $bundle = Reflection::getShortBundleRepository($entity); |
| 73 | 73 | |
| 74 | - return $env->render('MykeesMediaBundle:Media:editor/tinymce.html.twig',[ |
|
| 74 | + return $env->render('MykeesMediaBundle:Media:editor/tinymce.html.twig', [ |
|
| 75 | 75 | 'model'=>$model, |
| 76 | 76 | 'model_id'=>$model_id, |
| 77 | 77 | 'bundle'=> $bundle, |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | ]; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function getImage($image, $width, $height, $options=[]) |
|
| 30 | + public function getImage($image, $width, $height, $options = []) |
|
| 31 | 31 | { |
| 32 | 32 | $attr = false; |
| 33 | - foreach($options as $k=>$opt) |
|
| 33 | + foreach ($options as $k=>$opt) |
|
| 34 | 34 | { |
| 35 | - if( $k > 1 ){ |
|
| 35 | + if ($k > 1) { |
|
| 36 | 36 | $attr .= ' '; |
| 37 | 37 | } |
| 38 | 38 | $attr .= $k.'="'.$opt.'"'; |
@@ -40,13 +40,13 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $webroot = $this->rootDir.'/../web/'; |
| 42 | 42 | $info = pathinfo($image); |
| 43 | - $imageResize = $info['dirname'] . '/' . $info['filename'] . "_$width" . "x$height" . '.jpg'; |
|
| 44 | - $fullPathImageResize = $webroot . $imageResize; |
|
| 43 | + $imageResize = $info['dirname'].'/'.$info['filename']."_$width"."x$height".'.jpg'; |
|
| 44 | + $fullPathImageResize = $webroot.$imageResize; |
|
| 45 | 45 | |
| 46 | - if(file_exists($fullPathImageResize)) |
|
| 46 | + if (file_exists($fullPathImageResize)) |
|
| 47 | 47 | { |
| 48 | - return '<img src="'. $imageResize .'" '. $attr .'>'; |
|
| 49 | - } else { |
|
| 48 | + return '<img src="'.$imageResize.'" '.$attr.'>'; |
|
| 49 | + }else { |
|
| 50 | 50 | return false; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -32,28 +32,28 @@ discard block |
||
| 32 | 32 | public function testListMedias() |
| 33 | 33 | { |
| 34 | 34 | $crawler = $this->client->request('GET', '/admin/medias/Post/MvcBlogBundle/1'); |
| 35 | - $this->assertEquals(200,$this->client->getResponse()->getStatusCode()); |
|
| 36 | - $this->assertEquals(2,$crawler->filter('.count-tr')->count()); |
|
| 35 | + $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); |
|
| 36 | + $this->assertEquals(2, $crawler->filter('.count-tr')->count()); |
|
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | $crawler = $this->client->request('GET', '/admin/medias/Post/MvcBlogBundle/2'); |
| 40 | - $this->assertEquals(200,$this->client->getResponse()->getStatusCode()); |
|
| 41 | - $this->assertEquals(1,$crawler->filter('.count-tr')->count()); |
|
| 40 | + $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); |
|
| 41 | + $this->assertEquals(1, $crawler->filter('.count-tr')->count()); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function testFindAllMediasForAModel() |
| 45 | 45 | { |
| 46 | - $medias = $this->manager->findMediasByModelAndId('Post',1); |
|
| 47 | - $this->assertGreaterThan(1,count($medias)); |
|
| 46 | + $medias = $this->manager->findMediasByModelAndId('Post', 1); |
|
| 47 | + $this->assertGreaterThan(1, count($medias)); |
|
| 48 | 48 | $this->assertEquals(2, count($medias)); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function testRemoveFile() |
| 52 | 52 | { |
| 53 | 53 | $this->client->request('GET', '/admin/medias/delete/Post/MvcBlogBundle/9'); |
| 54 | - $this->assertEquals(200,$this->client->getResponse()->getStatusCode()); |
|
| 54 | + $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); |
|
| 55 | 55 | |
| 56 | - $medias = $this->manager->findMediasByModelAndId('Post',2); |
|
| 56 | + $medias = $this->manager->findMediasByModelAndId('Post', 2); |
|
| 57 | 57 | $this->assertEquals(0, count($medias)); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | ['HTTP_X-Requested-With' => 'XMLHttpRequest'] |
| 76 | 76 | ); |
| 77 | 77 | |
| 78 | - $this->assertEquals(200,$this->client->getResponse()->getStatusCode()); |
|
| 79 | - $medias = $this->manager->findMediasByModelAndId('Post',13); |
|
| 78 | + $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); |
|
| 79 | + $medias = $this->manager->findMediasByModelAndId('Post', 13); |
|
| 80 | 80 | |
| 81 | 81 | $this->assertEquals(1, count($medias)); |
| 82 | 82 | |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | ['HTTP_X-Requested-With' => 'XMLHttpRequest'] |
| 100 | 100 | ); |
| 101 | 101 | |
| 102 | - $this->assertEquals(500,$this->client->getResponse()->getStatusCode()); |
|
| 102 | + $this->assertEquals(500, $this->client->getResponse()->getStatusCode()); |
|
| 103 | 103 | |
| 104 | 104 | $this->manager = $this->container->get('mk.media.manager'); |
| 105 | - $medias = $this->manager->findMediasByModelAndId('Post',17); |
|
| 105 | + $medias = $this->manager->findMediasByModelAndId('Post', 17); |
|
| 106 | 106 | $this->assertEquals(0, count($medias)); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | namespace Mykees\MediaBundle\Interfaces; |
| 10 | 10 | |
| 11 | 11 | |
| 12 | -Interface Mediable{ |
|
| 12 | +Interface Mediable { |
|
| 13 | 13 | |
| 14 | 14 | public function getId(); |
| 15 | 15 | } |