Skip to content

Commit

Permalink
Fix behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
that-guy-iain committed Feb 28, 2024
1 parent 9fe55cb commit f00fdfb
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/Behat/UserContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,17 @@ public function thereWillBeAnInviteCodeFor($email)
throw new \Exception('No invite code found');
}
}
/**
* @Then there will not be an invite code for :arg1
*/
public function thereWillNotBeAnInviteCodeFor($email)
{
$inviteCode = $this->inviteCodeRepository->findOneBy(['email' => $email]);

if ($inviteCode) {
throw new \Exception('invite code found');
}
}

/**
* @Given the invite code :arg1 exists
Expand All @@ -632,6 +643,32 @@ public function theInviteCode($code)
$this->inviteCodeRepository->getEntityManager()->flush();
}


/**
* @When I edit my settings with the name :arg1
*/
public function iEditMySettingsWithTheName($arg1)
{
$this->sendJsonRequest('GET', '/api/user/settings');
$content = $this->getJsonContent()['form'];
$output = [];
foreach ($content as $key => $options) {
$output[$key] = $options;
}

$output['name'] = $arg1;
$this->sendJsonRequest('POST', '/api/user/settings', $output);
}


/**
* @When I visit the settings page
*/
public function iVisitTheSettingsPage()
{
$this->session->visit('/api/user/settings');
}

/**
* @When I try to sign up with the code :arg1
*/
Expand Down

0 comments on commit f00fdfb

Please sign in to comment.