Commit 7c6f2a50 authored by Dominique Merle's avatar Dominique Merle 💬
Browse files

Set up the step counting users in the database.

Use `Entity::class` notation for better refactoring and static analysis.
parent f93bb9c4
......@@ -361,7 +361,7 @@ class BaseFeatureContext extends WebTestCase implements Context
{
$count = $this->getEntityManager()->createQueryBuilder()
->select('COUNT(e)')
->from(sprintf('App:%s', $what), 'e')
->from(sprintf('%s', $what), 'e')
->getQuery()
->execute()[0][1];
......
......@@ -8,6 +8,7 @@
use App\Entity\LimajuPoll;
use App\Entity\LimajuPollOption;
use App\Entity\User;
/**
......@@ -99,12 +100,12 @@ class MainFeatureContext extends BaseFeatureContext
/**
* @Then /^there should(?: now)?(?: still)?(?: only)? be (?P<thatMuch>.+) citizens? in the database$/u
* @Then /^(?:qu')?il(?: ne)? d(?:oi|evrai)t(?: maintenant)? y avoir (?P<thatMuch>.+) citoyen(?:⋅?ne)?s? dans la base de données$/u
* @Then /^there should(?: now)?(?: still)?(?: only)? be (?P<thatMuch>.+) users? in the database$/u
* @Then /^(?:qu')?il(?: ne)? d(?:oi|evrai)t(?: maintenant)? y avoir (?P<thatMuch>.+) utilisateur(?:⋅?e)?s? dans la base de données$/ui
*/
public function thereShouldBeSomeCitizensInTheDatabase($thatMuch)
public function thereShouldBeSomeUsersInTheDatabase($thatMuch)
{
$this->thereShouldBeExactlyThatMuchEntitiesInTheDatabase($thatMuch, 'Citizen');
$this->thereShouldBeExactlyThatMuchEntitiesInTheDatabase($thatMuch, User::class);
}
......@@ -114,7 +115,7 @@ class MainFeatureContext extends BaseFeatureContext
*/
public function thereShouldBeSomeLimajuPollsInTheDatabase($thatMuch)
{
$this->thereShouldBeExactlyThatMuchEntitiesInTheDatabase($thatMuch, 'LimajuPoll');
$this->thereShouldBeExactlyThatMuchEntitiesInTheDatabase($thatMuch, LimajuPoll::class);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment