@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * Define the extensions to be tested |
38 | 38 | * |
39 | - * @return array vendor/name of extension(s) to test |
|
39 | + * @return string[] vendor/name of extension(s) to test |
|
40 | 40 | */ |
41 | 41 | static protected function setup_extensions() |
42 | 42 | { |
@@ -221,6 +221,9 @@ discard block |
||
221 | 221 | $this->core_categorie->set_extension_manager($phpbb_extension_manager); |
222 | 222 | } |
223 | 223 | |
224 | + /** |
|
225 | + * @param \ernadoo\phpbbdirectory\cron\task\core\prune_categorie[] $tasks |
|
226 | + */ |
|
224 | 227 | private function create_cron_manager($tasks) |
225 | 228 | { |
226 | 229 | global $phpbb_root_path, $phpEx; |
@@ -34,10 +34,10 @@ |
||
34 | 34 | protected $user; |
35 | 35 | |
36 | 36 | /** |
37 | - * Define the extensions to be tested |
|
38 | - * |
|
39 | - * @return array vendor/name of extension(s) to test |
|
40 | - */ |
|
37 | + * Define the extensions to be tested |
|
38 | + * |
|
39 | + * @return array vendor/name of extension(s) to test |
|
40 | + */ |
|
41 | 41 | static protected function setup_extensions() |
42 | 42 | { |
43 | 43 | return array('ernadoo/phpbbdirectory'); |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | |
52 | 52 | parent::setUp(); |
53 | 53 | |
54 | - $table_categories = 'phpbb_directory_cats'; |
|
55 | - $tables_comments = 'phpbb_directory_comments'; |
|
54 | + $table_categories = 'phpbb_directory_cats'; |
|
55 | + $tables_comments = 'phpbb_directory_comments'; |
|
56 | 56 | $tables_links = 'phpbb_directory_links'; |
57 | 57 | $tables_votes = 'phpbb_directory_votes'; |
58 | 58 | $tables_watch = 'phpbb_directory_watch'; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | $this->helper->expects($this->any()) |
102 | 102 | ->method('render') |
103 | - ->willReturnCallback(function ($template_file, $page_title = '', $status_code = 200, $display_online_list = false) { |
|
103 | + ->willReturnCallback(function($template_file, $page_title = '', $status_code = 200, $display_online_list = false) { |
|
104 | 104 | return new \Symfony\Component\HttpFoundation\Response($template_file, $status_code); |
105 | 105 | }); |
106 | 106 | $this->helper |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $phpbb_container->set('path_helper', $phpbb_path_helper); |
132 | 132 | $phpbb_container->set('ext.manager', $phpbb_extension_manager); |
133 | 133 | $phpbb_container->set('user', $this->user); |
134 | - $phpbb_container->setParameter('core.cache_dir', $phpbb_root_path . 'cache/' . PHPBB_ENVIRONMENT . '/'); |
|
134 | + $phpbb_container->setParameter('core.cache_dir', $phpbb_root_path.'cache/'.PHPBB_ENVIRONMENT.'/'); |
|
135 | 135 | |
136 | 136 | $context = new \phpbb\template\context(); |
137 | 137 | $twig_extension = new \phpbb\template\twig\extension($context, $this->lang); |
@@ -100,7 +100,8 @@ |
||
100 | 100 | |
101 | 101 | $this->helper->expects($this->any()) |
102 | 102 | ->method('render') |
103 | - ->willReturnCallback(function ($template_file, $page_title = '', $status_code = 200, $display_online_list = false) { |
|
103 | + ->willReturnCallback(function ($template_file, $page_title = '', $status_code = 200, $display_online_list = false) |
|
104 | + { |
|
104 | 105 | return new \Symfony\Component\HttpFoundation\Response($template_file, $status_code); |
105 | 106 | }); |
106 | 107 | $this->helper |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
25 | - * Setup test environment |
|
26 | - */ |
|
25 | + * Setup test environment |
|
26 | + */ |
|
27 | 27 | public function setUp() |
28 | 28 | { |
29 | 29 | parent::setUp(); |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
64 | - * Test data for the test_display_base() function |
|
65 | - * |
|
66 | - * @return array Array of test data |
|
67 | - */ |
|
64 | + * Test data for the test_display_base() function |
|
65 | + * |
|
66 | + * @return array Array of test data |
|
67 | + */ |
|
68 | 68 | public function display_base_data() |
69 | 69 | { |
70 | 70 | return array( |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
76 | - * Test controller display |
|
77 | - * |
|
78 | - * @dataProvider display_base_data |
|
79 | - */ |
|
76 | + * Test controller display |
|
77 | + * |
|
78 | + * @dataProvider display_base_data |
|
79 | + */ |
|
80 | 80 | public function test_display_base($status_code, $page_content) |
81 | 81 | { |
82 | 82 | $controller = $this->get_controller(); |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * Test base case scenario |
|
91 | - * |
|
92 | - */ |
|
90 | + * Test base case scenario |
|
91 | + * |
|
92 | + */ |
|
93 | 93 | public function test_for_root_categories() |
94 | 94 | { |
95 | 95 | $this->template->expects($this->exactly(2)) |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | public function getDataSet() |
20 | 20 | { |
21 | - return $this->createMySQLXMLDataSet(__DIR__ . './fixtures/fixture_base.xml'); |
|
21 | + return $this->createMySQLXMLDataSet(__DIR__.'./fixtures/fixture_base.xml'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
25 | - * Setup test environment |
|
26 | - */ |
|
25 | + * Setup test environment |
|
26 | + */ |
|
27 | 27 | public function setUp() |
28 | 28 | { |
29 | 29 | parent::setUp(); |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
68 | - * Test data for the test_display_cat_by_id() function |
|
69 | - * |
|
70 | - * @return array Array of test data |
|
71 | - */ |
|
68 | + * Test data for the test_display_cat_by_id() function |
|
69 | + * |
|
70 | + * @return array Array of test data |
|
71 | + */ |
|
72 | 72 | public function display_cat_by_id_data() |
73 | 73 | { |
74 | 74 | return array( |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
80 | - * Test controller display |
|
81 | - * |
|
82 | - * @dataProvider display_cat_by_id_data |
|
83 | - */ |
|
80 | + * Test controller display |
|
81 | + * |
|
82 | + * @dataProvider display_cat_by_id_data |
|
83 | + */ |
|
84 | 84 | public function test_display_cat_by_id($cat_id, $page, $status_code) |
85 | 85 | { |
86 | 86 | $controller = $this->get_controller(); |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
124 | - * Test data for the test_display_cat_fails() function |
|
125 | - * |
|
126 | - * @return array Array of test data |
|
127 | - */ |
|
124 | + * Test data for the test_display_cat_fails() function |
|
125 | + * |
|
126 | + * @return array Array of test data |
|
127 | + */ |
|
128 | 128 | public function display_cat_fails_data() |
129 | 129 | { |
130 | 130 | return array( |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
136 | - * Test controller display throws 404 exceptions |
|
137 | - * |
|
138 | - * @dataProvider display_cat_fails_data |
|
139 | - */ |
|
136 | + * Test controller display throws 404 exceptions |
|
137 | + * |
|
138 | + * @dataProvider display_cat_fails_data |
|
139 | + */ |
|
140 | 140 | public function test_display_cat_fails($cat_id, $page, $status_code, $page_content) |
141 | 141 | { |
142 | 142 | $controller = $this->get_controller(); |
@@ -153,10 +153,10 @@ discard block |
||
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
156 | - * Test data for the test_category_one_page() function |
|
157 | - * |
|
158 | - * @return array Array of test data |
|
159 | - */ |
|
156 | + * Test data for the test_category_one_page() function |
|
157 | + * |
|
158 | + * @return array Array of test data |
|
159 | + */ |
|
160 | 160 | public function category_one_page_data() |
161 | 161 | { |
162 | 162 | return array( |
@@ -165,10 +165,10 @@ discard block |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
168 | - * Test base case scenario |
|
169 | - * |
|
170 | - * @dataProvider category_one_page_data |
|
171 | - */ |
|
168 | + * Test base case scenario |
|
169 | + * |
|
170 | + * @dataProvider category_one_page_data |
|
171 | + */ |
|
172 | 172 | function test_category_one_page($cat_id, $cat_name, $parent_cat_id, $nb_links) |
173 | 173 | { |
174 | 174 | $controller = $this->get_controller(); |
@@ -178,10 +178,10 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
181 | - * Test data for the test_category_no_links() function |
|
182 | - * |
|
183 | - * @return array Array of test data |
|
184 | - */ |
|
181 | + * Test data for the test_category_no_links() function |
|
182 | + * |
|
183 | + * @return array Array of test data |
|
184 | + */ |
|
185 | 185 | public function category_no_links_data() |
186 | 186 | { |
187 | 187 | return array( |
@@ -190,10 +190,10 @@ discard block |
||
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
193 | - * Test base case scenario |
|
194 | - * |
|
195 | - * @dataProvider category_no_links_data |
|
196 | - */ |
|
193 | + * Test base case scenario |
|
194 | + * |
|
195 | + * @dataProvider category_no_links_data |
|
196 | + */ |
|
197 | 197 | function test_category_no_links($cat_id, $cat_name, $nb_links) |
198 | 198 | { |
199 | 199 | $this->template->expects($this->at(3)) |
@@ -209,10 +209,10 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
212 | - * Test data for the test_category_with_pages() function |
|
213 | - * |
|
214 | - * @return array Array of test data |
|
215 | - */ |
|
212 | + * Test data for the test_category_with_pages() function |
|
213 | + * |
|
214 | + * @return array Array of test data |
|
215 | + */ |
|
216 | 216 | public function category_with_pages_data() |
217 | 217 | { |
218 | 218 | return array( |
@@ -222,10 +222,10 @@ discard block |
||
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
225 | - * Test base case scenario |
|
226 | - * |
|
227 | - * @dataProvider category_with_pages_data |
|
228 | - */ |
|
225 | + * Test base case scenario |
|
226 | + * |
|
227 | + * @dataProvider category_with_pages_data |
|
228 | + */ |
|
229 | 229 | public function test_category_with_pages($cat_id, $cat_name, $parent_cat_id, $parent_cat_name, $nb_links, $page = 1, $sort_days = 0) |
230 | 230 | { |
231 | 231 | $controller = $this->get_controller(); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | public function getDataSet() |
20 | 20 | { |
21 | - return $this->createMySQLXMLDataSet(__DIR__ . './fixtures/fixture_categories.xml'); |
|
21 | + return $this->createMySQLXMLDataSet(__DIR__.'./fixtures/fixture_categories.xml'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | class categories_routing_loader_test extends \phpbb_database_test_case |
14 | 14 | { |
15 | 15 | /** |
16 | - * Define the extensions to be tested |
|
17 | - * |
|
18 | - * @return array vendor/name of extension(s) to test |
|
19 | - */ |
|
16 | + * Define the extensions to be tested |
|
17 | + * |
|
18 | + * @return array vendor/name of extension(s) to test |
|
19 | + */ |
|
20 | 20 | static protected function setup_extensions() |
21 | 21 | { |
22 | 22 | return array('ernadoo/phpbbdirectory'); |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | - * Get the route collection from the categories_loader |
|
54 | - * |
|
55 | - * @return \Symfony\Component\Routing\RouteCollection |
|
56 | - */ |
|
53 | + * Get the route collection from the categories_loader |
|
54 | + * |
|
55 | + * @return \Symfony\Component\Routing\RouteCollection |
|
56 | + */ |
|
57 | 57 | public function get_categories_route_collection() |
58 | 58 | { |
59 | 59 | $collection = $this->loader->load('ernadoo_phpbbdirectory_route_controller', 'pages_extension'); |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
68 | - * Data set for test_page_loader |
|
69 | - * |
|
70 | - * @return array |
|
71 | - */ |
|
68 | + * Data set for test_page_loader |
|
69 | + * |
|
70 | + * @return array |
|
71 | + */ |
|
72 | 72 | public function page_loader_data() |
73 | 73 | { |
74 | 74 | return array( |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
82 | - * @dataProvider page_loader_data |
|
83 | - * |
|
84 | - * @param int $id Id of a categorie |
|
85 | - * @param string $expected Expected route of a categorie |
|
86 | - */ |
|
82 | + * @dataProvider page_loader_data |
|
83 | + * |
|
84 | + * @param int $id Id of a categorie |
|
85 | + * @param string $expected Expected route of a categorie |
|
86 | + */ |
|
87 | 87 | public function test_page_loader($id, $expected) |
88 | 88 | { |
89 | 89 | // Get a route instance |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | public function getDataSet() |
35 | 35 | { |
36 | - return $this->createMySQLXMLDataSet(__DIR__ . '/fixtures/categories.xml'); |
|
36 | + return $this->createMySQLXMLDataSet(__DIR__.'/fixtures/categories.xml'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function setUp() |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | public function test_page_loader($id, $expected) |
88 | 88 | { |
89 | 89 | // Get a route instance |
90 | - $route = $this->collection->get('ernadoo_phpbbdirectory_dynamic_route_' . $id); |
|
90 | + $route = $this->collection->get('ernadoo_phpbbdirectory_dynamic_route_'.$id); |
|
91 | 91 | |
92 | 92 | // Assert the roue is an instance of Route |
93 | 93 | $this->assertInstanceOf('Symfony\Component\Routing\Route', $route, 'A route instance could not be made.'); |