@@ 330-348 (lines=19) @@ | ||
327 | } |
|
328 | } |
|
329 | ||
330 | protected function assertBulk() |
|
331 | { |
|
332 | $content = file_get_contents($this->tmpDir . '/Controller/PostController.php'); |
|
333 | $strings = array( |
|
334 | 'public function deleteById', |
|
335 | ); |
|
336 | foreach ($strings as $string) { |
|
337 | $this->assertContains($string, $content); |
|
338 | } |
|
339 | ||
340 | ||
341 | $content = file_get_contents($this->tmpDir . '/Resources/views/post/index.html.twig'); |
|
342 | $strings = array( |
|
343 | '<select class = "form-control" name="bulk_action" >', |
|
344 | ); |
|
345 | foreach ($strings as $string) { |
|
346 | $this->assertContains($string, $content); |
|
347 | } |
|
348 | } |
|
349 | ||
350 | protected function assertSorting() |
|
351 | { |
|
@@ 350-369 (lines=20) @@ | ||
347 | } |
|
348 | } |
|
349 | ||
350 | protected function assertSorting() |
|
351 | { |
|
352 | $content = file_get_contents($this->tmpDir . '/Controller/PostController.php'); |
|
353 | $strings = array( |
|
354 | '$queryBuilder->orderBy($sortCol, $request->get(\'pcg_sort_order\', \'desc\'));', |
|
355 | ); |
|
356 | foreach ($strings as $string) { |
|
357 | $this->assertContains($string, $content); |
|
358 | } |
|
359 | ||
360 | ||
361 | $content = file_get_contents($this->tmpDir . '/Resources/views/post/index.html.twig'); |
|
362 | $strings = array( |
|
363 | '{% import "PetkoparaCrudGeneratorBundle::macros/th_sortable.html.twig" as macros %}', |
|
364 | 'macros.th_sortable', |
|
365 | ); |
|
366 | foreach ($strings as $string) { |
|
367 | $this->assertContains($string, $content); |
|
368 | } |
|
369 | } |
|
370 | ||
371 | protected function assertPageSize() |
|
372 | { |
|
@@ 371-390 (lines=20) @@ | ||
368 | } |
|
369 | } |
|
370 | ||
371 | protected function assertPageSize() |
|
372 | { |
|
373 | $content = file_get_contents($this->tmpDir . '/Controller/PostController.php'); |
|
374 | $strings = array( |
|
375 | '$pagerfanta->setCurrentPage($request->get(\'pcg_page\', 1));', |
|
376 | ); |
|
377 | foreach ($strings as $string) { |
|
378 | $this->assertContains($string, $content); |
|
379 | } |
|
380 | ||
381 | ||
382 | $content = file_get_contents($this->tmpDir . '/Resources/views/post/index.html.twig'); |
|
383 | $strings = array( |
|
384 | '<select class = "form-control" onchange="window.location = this.value" >', |
|
385 | '<option value=\'{{ path(\'post\', app.request.query.all|merge({\'pcg_show\': \'10\'})) }}\' {% if app.request.get(\'pcg_show\') == 10 %} selected {% endif %}>10</option>', |
|
386 | ); |
|
387 | foreach ($strings as $string) { |
|
388 | $this->assertContains($string, $content); |
|
389 | } |
|
390 | } |
|
391 | ||
392 | } |
|
393 |