mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 22:04:23 +00:00
fix gitlab tests
This commit is contained in:
parent
5a3f360822
commit
332bec6e83
@ -16,11 +16,12 @@ stages:
|
|||||||
- build-doc
|
- build-doc
|
||||||
- deploy-doc
|
- deploy-doc
|
||||||
|
|
||||||
test:php-5.6:
|
test:php-7.1:
|
||||||
stage: test
|
stage: test
|
||||||
image: chill/ci-image:php-5.6
|
image: chill/ci-image:php-7.1
|
||||||
<<: *test_definition
|
<<: *test_definition
|
||||||
script: phpunit
|
script: phpunit
|
||||||
|
|
||||||
test:php-7:
|
test:php-7:
|
||||||
stage: test
|
stage: test
|
||||||
image: chill/ci-image:php-7
|
image: chill/ci-image:php-7
|
||||||
|
@ -52,12 +52,32 @@ class ReportController extends Controller
|
|||||||
$reachableScopes = $this->get('chill.main.security.authorization.helper')
|
$reachableScopes = $this->get('chill.main.security.authorization.helper')
|
||||||
->getReachableScopes($this->getUser(), new Role('CHILL_REPORT_SEE'),
|
->getReachableScopes($this->getUser(), new Role('CHILL_REPORT_SEE'),
|
||||||
$person->getCenter());
|
$person->getCenter());
|
||||||
$reports = $em->getRepository('ChillReportBundle:Report')
|
|
||||||
->findBy(array('person' => $person, 'scope' => $reachableScopes));
|
$total = $em
|
||||||
|
->createQuery("SELECT COUNT(r.id) FROM ChillReportBundle:Report r "
|
||||||
|
. "WHERE r.person = :person AND r.scope IN (:scopes) ")
|
||||||
|
->setParameter('person', $person)
|
||||||
|
->setParameter('scopes', $reachableScopes)
|
||||||
|
->getSingleScalarResult();
|
||||||
|
|
||||||
|
// get the PaginatorFactory
|
||||||
|
$paginator = $this->get('chill_main.paginator_factory')->create($total);
|
||||||
|
|
||||||
|
$reports = $em->createQuery('SELECT r
|
||||||
|
FROM ChillReportBundle:Report r
|
||||||
|
WHERE r.person = :person AND r.scope IN (:scopes)
|
||||||
|
ORDER BY r.date DESC')
|
||||||
|
->setParameter('person', $person)
|
||||||
|
->setParameter('scopes', $reachableScopes)
|
||||||
|
->setFirstResult($paginator->getCurrentPage()->getFirstItemNumber())
|
||||||
|
->setMaxResults($paginator->getItemsPerPage())
|
||||||
|
->getResult()
|
||||||
|
;
|
||||||
|
|
||||||
return $this->render('ChillReportBundle:Report:list.html.twig', array(
|
return $this->render('ChillReportBundle:Report:list.html.twig', array(
|
||||||
'reports' => $reports,
|
'reports' => $reports,
|
||||||
'person' => $person
|
'person' => $person,
|
||||||
|
'paginator' => $paginator
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +64,10 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
{% if reports|length < paginator.getTotalItems %}
|
||||||
|
{{ chill_pagination(paginator) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
@ -30,24 +30,28 @@
|
|||||||
"chill-project/person": "dev-master",
|
"chill-project/person": "dev-master",
|
||||||
"champs-libres/composer-bundle-migration": "~1.0",
|
"champs-libres/composer-bundle-migration": "~1.0",
|
||||||
"doctrine/doctrine-migrations-bundle": "~1.1",
|
"doctrine/doctrine-migrations-bundle": "~1.1",
|
||||||
"doctrine/migrations": "~1.0@dev"
|
"doctrine/migrations": "~1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"doctrine/doctrine-fixtures-bundle": "~2.2",
|
"doctrine/doctrine-fixtures-bundle": "~2.2",
|
||||||
"fzaninotto/faker": "~1",
|
"fzaninotto/faker": "~1",
|
||||||
"monolog/monolog": "^1.14",
|
"monolog/monolog": "^1.14",
|
||||||
"symfony/monolog-bundle": "^2.7"
|
"symfony/monolog-bundle": "^2.7",
|
||||||
|
"phpunit/phpunit": "~5.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"post-install-cmd": [
|
"post-install-cmd": [
|
||||||
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations"
|
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations",
|
||||||
|
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
|
||||||
],
|
],
|
||||||
"post-update-cmd": [
|
"post-update-cmd": [
|
||||||
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations"
|
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations",
|
||||||
|
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"app-migrations-dir": "Tests/Fixtures/App/app/DoctrineMigrations"
|
"app-migrations-dir": "Tests/Fixtures/App/app/DoctrineMigrations",
|
||||||
|
"symfony-app-dir": "Tests/Fixtures/App/app"
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"prefer-stable": true
|
"prefer-stable": true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user