@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function load(ObjectManager $manager) |
44 | 44 | { |
45 | - for ($i=0; self::NUMBER_OF_NODE > $i; $i++) { |
|
46 | - $name = 'node' . $i; |
|
47 | - $pattern = '/node' . $i; |
|
48 | - $content = 'Node ' . $i . 'on ' . self::NUMBER_OF_NODE; |
|
45 | + for ($i = 0; self::NUMBER_OF_NODE > $i; $i++) { |
|
46 | + $name = 'node'.$i; |
|
47 | + $pattern = '/node'.$i; |
|
48 | + $content = 'Node '.$i.'on '.self::NUMBER_OF_NODE; |
|
49 | 49 | $this->generateSimpleNode($name, 'en', $manager, $content, $pattern); |
50 | 50 | $this->generateSimpleNode($name, 'fr', $manager, $content, $pattern); |
51 | 51 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $titleBlock = new Block(); |
79 | 79 | $titleBlock->setClass('block-body-header'); |
80 | 80 | $titleBlock->setComponent(TinyMCEWysiwygStrategy::TINYMCEWYSIWYG); |
81 | - $titleBlock->setAttributes(array('htmlContent' => '<h1>' . $name . '</h1>')); |
|
81 | + $titleBlock->setAttributes(array('htmlContent' => '<h1>'.$name.'</h1>')); |
|
82 | 82 | |
83 | 83 | $contentBlock = new Block(); |
84 | 84 | $contentBlock->setClass('block-body'); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
168 | - * @param $data |
|
168 | + * @param BlockInterface $data |
|
169 | 169 | */ |
170 | 170 | protected function assertBlock($data) |
171 | 171 | { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | /** |
178 | 178 | * @param string $condition |
179 | 179 | * |
180 | - * @return array |
|
180 | + * @return string |
|
181 | 181 | */ |
182 | 182 | protected function replaceKeywordLabelById($condition) |
183 | 183 | { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $block->setComponent(VideoStrategy::NAME); |
46 | 46 | $block->addAttribute('videoType', 'youtube'); |
47 | 47 | $block->addAttribute('youtubeFs', true); |
48 | - $formType = static::$kernel->getContainer()->get('open_orchestra_backoffice.generate_form_manager')->getFormType($block); |
|
48 | + $formType = static::$kernel->getContainer()->get('open_orchestra_backoffice.generate_form_manager')->getFormType($block); |
|
49 | 49 | $form = $this->formFactory->create($formType, $block, array('csrf_protection' => false)); |
50 | 50 | |
51 | 51 | $form->submit(array( |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | { |
76 | 76 | $block = new Block(); |
77 | 77 | $block->setComponent($component); |
78 | - $formType = static::$kernel->getContainer()->get('open_orchestra_backoffice.generate_form_manager')->getFormType($block); |
|
78 | + $formType = static::$kernel->getContainer()->get('open_orchestra_backoffice.generate_form_manager')->getFormType($block); |
|
79 | 79 | |
80 | 80 | $form = $this->formFactory->create($formType, $block, array('csrf_protection' => false)); |
81 | 81 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | { |
130 | 130 | $block = new Block(); |
131 | 131 | $block->setComponent($component); |
132 | - $formType = static::$kernel->getContainer()->get('open_orchestra_backoffice.generate_form_manager')->getFormType($block); |
|
132 | + $formType = static::$kernel->getContainer()->get('open_orchestra_backoffice.generate_form_manager')->getFormType($block); |
|
133 | 133 | |
134 | 134 | $form = $this->formFactory->create($formType, $block, array('csrf_protection' => false)); |
135 | 135 | $submittedValue = array_merge(array('id' => 'testId', 'class' => 'testClass'), $value); |
@@ -48,20 +48,20 @@ discard block |
||
48 | 48 | $formType = static::$kernel->getContainer()->get('open_orchestra_backoffice.generate_form_manager')->getFormType($block); |
49 | 49 | $form = $this->formFactory->create($formType, $block, array('csrf_protection' => false)); |
50 | 50 | |
51 | - $form->submit(array( |
|
52 | - 'style' => 'default', |
|
53 | - 'videoType' => 'youtube', |
|
54 | - 'youtubeVideoId' => 'videoId', |
|
55 | - 'youtubeAutoplay' => true, |
|
56 | - )); |
|
57 | - |
|
58 | - $this->assertTrue($form->isSynchronized()); |
|
59 | - /** @var BlockInterface $data */ |
|
60 | - $data = $form->getConfig()->getData(); |
|
61 | - $this->assertBlock($data); |
|
62 | - $this->assertSame('videoId', $data->getAttribute('youtubeVideoId')); |
|
63 | - $this->assertTrue($data->getAttribute('youtubeAutoplay')); |
|
64 | - $this->assertFalse($data->getAttribute('youtubeFs')); |
|
51 | + $form->submit(array( |
|
52 | + 'style' => 'default', |
|
53 | + 'videoType' => 'youtube', |
|
54 | + 'youtubeVideoId' => 'videoId', |
|
55 | + 'youtubeAutoplay' => true, |
|
56 | + )); |
|
57 | + |
|
58 | + $this->assertTrue($form->isSynchronized()); |
|
59 | + /** @var BlockInterface $data */ |
|
60 | + $data = $form->getConfig()->getData(); |
|
61 | + $this->assertBlock($data); |
|
62 | + $this->assertSame('videoId', $data->getAttribute('youtubeVideoId')); |
|
63 | + $this->assertTrue($data->getAttribute('youtubeAutoplay')); |
|
64 | + $this->assertFalse($data->getAttribute('youtubeFs')); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | array(ContentListStrategy::NAME, array( |
100 | 100 | 'contentNodeId' => 'root', |
101 | 101 | 'contentSearch' => array( |
102 | - 'contentType' => 'news', |
|
103 | - 'choiceType' => 'choice_and', |
|
104 | - 'keywords' => null, |
|
102 | + 'contentType' => 'news', |
|
103 | + 'choiceType' => 'choice_and', |
|
104 | + 'keywords' => null, |
|
105 | 105 | ), |
106 | 106 | 'characterNumber' => 150, |
107 | 107 | 'contentTemplateEnabled' => true, |
@@ -548,7 +548,7 @@ |
||
548 | 548 | /** |
549 | 549 | * @param string $condition |
550 | 550 | * |
551 | - * @return array |
|
551 | + * @return string |
|
552 | 552 | */ |
553 | 553 | protected function replaceKeywordLabelById($condition) |
554 | 554 | { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | { |
161 | 161 | return array( |
162 | 162 | array('car', ContentRepositoryInterface::CHOICE_AND, 'lorem', 3), |
163 | - array('car',ContentRepositoryInterface::CHOICE_AND, 'sit', 1), |
|
163 | + array('car', ContentRepositoryInterface::CHOICE_AND, 'sit', 1), |
|
164 | 164 | array('car', ContentRepositoryInterface::CHOICE_AND, 'dolor', 0), |
165 | 165 | array('car', ContentRepositoryInterface::CHOICE_AND, 'sit AND lorem', 1), |
166 | 166 | array('news', ContentRepositoryInterface::CHOICE_AND, 'lorem', 1), |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $configuration->setPaginateConfiguration($order, $skip, $limit); |
289 | 289 | $contents = $this->repository->findPaginatedLastVersionByContentTypeAndsite($contentType, $configuration, $siteId); |
290 | 290 | |
291 | - if(!is_null($name)) { |
|
291 | + if (!is_null($name)) { |
|
292 | 292 | $this->assertEquals($name, $contents[0]->getName()); |
293 | 293 | } |
294 | 294 | $this->assertCount($count, $contents); |
@@ -302,21 +302,21 @@ discard block |
||
302 | 302 | $descriptionEntity = $this->getDescriptionColumnEntity(); |
303 | 303 | |
304 | 304 | return array( |
305 | - 1 => array('car', $descriptionEntity, null, array("name" => "name", "dir" => "asc"), null, 0 ,5 , 3, '206 3 portes en'), |
|
306 | - 2 => array('car', $descriptionEntity, null, array("name" => "name", "dir" => "desc"), null, 0 ,5 , 3, 'R5 3 portes en'), |
|
307 | - 3 => array('car', $descriptionEntity, null, array("name" => "attributes.car_name.string_value", "dir" => "asc"), null, 0 ,5 , 3, '206 3 portes en'), |
|
308 | - 4 => array('car', $descriptionEntity, null, array("name" => "attributes.car_name.string_value", "dir" => "desc"), null, 0 ,5 , 3, 'R5 3 portes en'), |
|
309 | - 5 => array('car', $descriptionEntity, null, null, null, 0 ,1 , 1), |
|
310 | - 6 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('name' => '206')), null, null, 0 ,2 , 1), |
|
311 | - 7 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('version' => '2')), null, null, 0 ,2 , 2), |
|
312 | - 8 => array('news', $descriptionEntity, null, null, null, 0 , 100, 4), |
|
313 | - 9 => array('news', $descriptionEntity, null, null, null, 50 , 100, 0), |
|
314 | - 10 => array('news', $descriptionEntity, $this->generateColumnsProvider(array('name' => 'news')), null, null, 0 , null, 0), |
|
315 | - 11 => array('car', $descriptionEntity, null, null, '2', 0 ,5 , 3), |
|
316 | - 12 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('status_label' => 'publish')), null, null, null ,null , 3), |
|
317 | - 13 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('status_label' => 'Publi')), null, null, null ,null , 3), |
|
318 | - 14 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('status_label' => 'draft')), null, null, null ,null , 0), |
|
319 | - 15 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('status_label' => 'brouillon')), null, null, null ,null , 0), |
|
305 | + 1 => array('car', $descriptionEntity, null, array("name" => "name", "dir" => "asc"), null, 0, 5, 3, '206 3 portes en'), |
|
306 | + 2 => array('car', $descriptionEntity, null, array("name" => "name", "dir" => "desc"), null, 0, 5, 3, 'R5 3 portes en'), |
|
307 | + 3 => array('car', $descriptionEntity, null, array("name" => "attributes.car_name.string_value", "dir" => "asc"), null, 0, 5, 3, '206 3 portes en'), |
|
308 | + 4 => array('car', $descriptionEntity, null, array("name" => "attributes.car_name.string_value", "dir" => "desc"), null, 0, 5, 3, 'R5 3 portes en'), |
|
309 | + 5 => array('car', $descriptionEntity, null, null, null, 0, 1, 1), |
|
310 | + 6 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('name' => '206')), null, null, 0, 2, 1), |
|
311 | + 7 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('version' => '2')), null, null, 0, 2, 2), |
|
312 | + 8 => array('news', $descriptionEntity, null, null, null, 0, 100, 4), |
|
313 | + 9 => array('news', $descriptionEntity, null, null, null, 50, 100, 0), |
|
314 | + 10 => array('news', $descriptionEntity, $this->generateColumnsProvider(array('name' => 'news')), null, null, 0, null, 0), |
|
315 | + 11 => array('car', $descriptionEntity, null, null, '2', 0, 5, 3), |
|
316 | + 12 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('status_label' => 'publish')), null, null, null, null, 3), |
|
317 | + 13 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('status_label' => 'Publi')), null, null, null, null, 3), |
|
318 | + 14 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('status_label' => 'draft')), null, null, null, null, 0), |
|
319 | + 15 => array('car', $descriptionEntity, $this->generateColumnsProvider(array('status_label' => 'brouillon')), null, null, null, null, 0), |
|
320 | 320 | |
321 | 321 | ); |
322 | 322 | } |
@@ -491,63 +491,63 @@ discard block |
||
491 | 491 | */ |
492 | 492 | protected function getDescriptionColumnEntity() |
493 | 493 | { |
494 | - return array ( |
|
494 | + return array( |
|
495 | 495 | 'name' => |
496 | - array ( |
|
496 | + array( |
|
497 | 497 | 'key' => 'name', |
498 | 498 | 'field' => 'name', |
499 | 499 | 'type' => 'string', |
500 | 500 | ), |
501 | 501 | 'language' => |
502 | - array ( |
|
502 | + array( |
|
503 | 503 | 'key' => 'language', |
504 | 504 | 'field' => 'language', |
505 | 505 | 'type' => 'string', |
506 | 506 | ), |
507 | 507 | 'status_label' => |
508 | - array ( |
|
508 | + array( |
|
509 | 509 | 'key' => 'status_label', |
510 | 510 | 'field' => 'status', |
511 | 511 | 'type' => 'multiLanguages', |
512 | 512 | ), |
513 | 513 | 'version' => |
514 | - array ( |
|
514 | + array( |
|
515 | 515 | 'key' => 'version', |
516 | 516 | 'field' => 'version', |
517 | 517 | 'type' => 'integer', |
518 | 518 | ), |
519 | 519 | 'linked_to_site' => |
520 | - array ( |
|
520 | + array( |
|
521 | 521 | 'key' => 'linked_to_site', |
522 | 522 | 'field' => 'linkedTosite', |
523 | 523 | 'type' => 'boolean', |
524 | 524 | ), |
525 | 525 | 'created_by' => |
526 | - array ( |
|
526 | + array( |
|
527 | 527 | 'key' => 'created_by', |
528 | 528 | 'field' => 'createdBy', |
529 | 529 | 'type' => 'string', |
530 | 530 | ), |
531 | 531 | 'updated_by' => |
532 | - array ( |
|
532 | + array( |
|
533 | 533 | 'key' => 'updated_by', |
534 | 534 | 'field' => 'updatedBy', |
535 | 535 | 'type' => 'string', |
536 | 536 | ), |
537 | 537 | 'created_at' => |
538 | - array ( |
|
538 | + array( |
|
539 | 539 | 'key' => 'created_at', |
540 | 540 | 'field' => 'createdAt', |
541 | 541 | 'type' => 'date', |
542 | 542 | ), |
543 | 543 | 'updated_at' => |
544 | - array ( |
|
544 | + array( |
|
545 | 545 | 'key' => 'updated_at', |
546 | 546 | 'field' => 'updatedAt', |
547 | 547 | 'type' => 'date', |
548 | 548 | ), |
549 | 549 | 'deleted' => |
550 | - array ( |
|
550 | + array( |
|
551 | 551 | 'key' => 'deleted', |
552 | 552 | 'field' => 'deleted', |
553 | 553 | 'type' => 'boolean', |
@@ -166,7 +166,7 @@ |
||
166 | 166 | /** |
167 | 167 | * Check if the $sites ids matches $expectedIds |
168 | 168 | * |
169 | - * @param array $expectedIds |
|
169 | + * @param string[] $expectedIds |
|
170 | 170 | * @param array $sites |
171 | 171 | */ |
172 | 172 | protected function assertIdsMatches($expectedIds, $sites) |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | $descriptionEntity = $this->getDescriptionColumnEntity(); |
57 | 57 | |
58 | 58 | return array( |
59 | - array(false, array(), null, 0 ,1 , 1), |
|
60 | - array(true, array(), null, 0 ,2 , 1), |
|
59 | + array(false, array(), null, 0, 1, 1), |
|
60 | + array(true, array(), null, 0, 2, 1), |
|
61 | 61 | array(false, $descriptionEntity, $this->generateSearchProvider(array('site_id' => '2'), 'demo'), null, null, 1), |
62 | 62 | array(false, $descriptionEntity, $this->generateSearchProvider(array('site_id' => '1'), 'demo'), null, null, 0), |
63 | 63 | array(false, $descriptionEntity, $this->generateSearchProvider(array('site_id' => '1', 'name' => 'demo')), null, null, 0), |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | $descriptionEntity = $this->getDescriptionColumnEntity(); |
91 | 91 | |
92 | 92 | return array( |
93 | - array(array(), $this->generateSearchProvider(array('deleted' => false)), 0 ,1 , 1), |
|
94 | - array(array(), $this->generateSearchProvider(array('deleted' => true)), 0 ,1 , 1), |
|
93 | + array(array(), $this->generateSearchProvider(array('deleted' => false)), 0, 1, 1), |
|
94 | + array(array(), $this->generateSearchProvider(array('deleted' => true)), 0, 1, 1), |
|
95 | 95 | array($descriptionEntity, $this->generateSearchProvider(array('deleted' => false, 'site_id' => '2'), 'demo'), null, null, 1), |
96 | 96 | array($descriptionEntity, $this->generateSearchProvider(array('deleted' => false, 'site_id' => '1'), 'demo'), null, null, 0), |
97 | 97 | array($descriptionEntity, $this->generateSearchProvider(array('deleted' => false, 'site_id' => '1', 'name' => 'demo')), null, null, 0), |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $tokenReponse = json_decode($this->client->getResponse()->getContent(), true); |
37 | 37 | $refreshToken = $tokenReponse['refresh_token']; |
38 | 38 | |
39 | - $this->client->request('GET', '/oauth/access_token?grant_type=refresh_token&refresh_token=' . $refreshToken, array(), array(), array('PHP_AUTH_USER' => 'test_key', 'PHP_AUTH_PW' => 'test_secret')); |
|
39 | + $this->client->request('GET', '/oauth/access_token?grant_type=refresh_token&refresh_token='.$refreshToken, array(), array(), array('PHP_AUTH_USER' => 'test_key', 'PHP_AUTH_PW' => 'test_secret')); |
|
40 | 40 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); |
41 | 41 | $this->assertSame('application/json', $this->client->getResponse()->headers->get('content-type')); |
42 | 42 | } |
@@ -71,7 +71,7 @@ |
||
71 | 71 | $mediaFolderRepository = static::$kernel->getContainer()->get('open_orchestra_media.repository.media_folder'); |
72 | 72 | $mediaFolder = $mediaFolderRepository->findOneByName('Images folder'); |
73 | 73 | |
74 | - $url = '/admin/folder/form/' . $mediaFolder->getId(); |
|
74 | + $url = '/admin/folder/form/'.$mediaFolder->getId(); |
|
75 | 75 | $crawler = $this->client->request('GET', $url); |
76 | 76 | |
77 | 77 | return $crawler; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | public function testMediaForms($form) |
33 | 33 | { |
34 | - $url = '/admin/media/' . $this->media->getId() . '/' . $form; |
|
34 | + $url = '/admin/media/'.$this->media->getId().'/'.$form; |
|
35 | 35 | |
36 | 36 | $this->client->request('GET', $url); |
37 | 37 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | public function testApi($url) |
20 | 20 | { |
21 | - $this->client->request('GET', $url . '?access_token=' . $this->getAccessToken()); |
|
21 | + $this->client->request('GET', $url.'?access_token='.$this->getAccessToken()); |
|
22 | 22 | |
23 | 23 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); |
24 | 24 | $this->assertSame('application/json', $this->client->getResponse()->headers->get('content-type')); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | $this->client->request( |
55 | 55 | 'POST', |
56 | - '/api/content/' . $content->getId() . '/update', |
|
56 | + '/api/content/'.$content->getId().'/update', |
|
57 | 57 | array(), |
58 | 58 | array(), |
59 | 59 | array(), |