/** * @Then /^the following users should be active:$/ * * @param TableNode $node */ public function checkUserActivity(TableNode $node) { /** @var \AppBundle\Service\Doctrine\Repository\UserRepository $repository */ $repository = $this->getContainer()->get('app.repository.user'); Assertion::eq($response = $this->apiContext->getResponse(), array_combine(array_map(function (array $data) use($repository) : string { return $repository->findOneBy(['username' => $data['username']])->getId(); }, $node->getHash()), array_fill(0, count($response), 1))); }
/** * @Then /^I should see suggestions for my username$/ */ public function checkNameSuggestions() { Assertion::keyIsset($this->apiContext->getResponse(), 'name_suggestions'); }