Tests: Add different user roles and change users filler to offer one of each

1.10.x
Yannick Warnier 11 years ago
parent 2fc26add12
commit 0cf87cd545
  1. 10
      tests/datafiller/data_users.php
  2. 99
      tests/features/bootstrap/FeatureContext.php

@ -177,10 +177,10 @@ $users[] = array(
); );
$users[] = array('username' => 'mbrandybuck', 'pass' => 'mbrandybuck', 'firstname' => 'Meriadoc', 'lastname' => 'Brandybuck', 'status' => 5, 'auth_source' => 'platform', 'email' => 'mbrandybuck@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'mbrandybuck', 'pass' => 'mbrandybuck', 'firstname' => 'Meriadoc', 'lastname' => 'Brandybuck', 'status' => 5, 'auth_source' => 'platform', 'email' => 'mbrandybuck@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'amaurichard', 'pass' => 'amaurichard', 'firstname' => 'Anabelle', 'lastname' => 'Maurichard', 'status' => 5, 'auth_source' => 'platform', 'email' => 'amaurichard@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'amaurichard', 'pass' => 'amaurichard', 'firstname' => 'Anabelle', 'lastname' => 'Maurichard', 'status' => 3, 'auth_source' => 'platform', 'email' => 'amaurichard@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'ptook', 'pass' => 'ptook', 'firstname' => 'Peregrin', 'lastname' => 'Took', 'status' => 5, 'auth_source' => 'platform', 'email' => 'ptook@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'ptook', 'pass' => 'ptook', 'firstname' => 'Peregrin', 'lastname' => 'Took', 'status' => 4, 'auth_source' => 'platform', 'email' => 'ptook@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'abaggins', 'pass' => 'abaggins', 'firstname' => 'Angelica', 'lastname' => 'Baggins', 'status' => 5, 'auth_source' => 'platform', 'email' => 'abaggins@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'abaggins', 'pass' => 'abaggins', 'firstname' => 'Angelica', 'lastname' => 'Baggins', 'status' => 17, 'auth_source' => 'platform', 'email' => 'abaggins@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'bproudfoot', 'pass' => 'bproudfoot', 'firstname' => 'Bodo', 'lastname' => 'Proudfoot', 'status' => 5, 'auth_source' => 'platform', 'email' => 'bproudfoot@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'bproudfoot', 'pass' => 'bproudfoot', 'firstname' => 'Bodo', 'lastname' => 'Proudfoot', 'status' => 20, 'auth_source' => 'platform', 'email' => 'bproudfoot@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'csackville', 'pass' => 'csackville', 'firstname' => 'Camelia', 'lastname' => 'Sackville', 'status' => 5, 'auth_source' => 'platform', 'email' => 'csackville@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'csackville', 'pass' => 'csackville', 'firstname' => 'Camelia', 'lastname' => 'Sackville', 'status' => 5, 'auth_source' => 'platform', 'email' => 'csackville@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'dboffin', 'pass' => 'dboffin', 'firstname' => 'Donnamira', 'lastname' => 'Boffin', 'status' => 5, 'auth_source' => 'platform', 'email' => 'dboffin@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'dboffin', 'pass' => 'dboffin', 'firstname' => 'Donnamira', 'lastname' => 'Boffin', 'status' => 5, 'auth_source' => 'platform', 'email' => 'dboffin@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'efairbairn', 'pass' => 'efairbairn', 'firstname' => 'Elfstan', 'lastname' => 'Fairbairn', 'status' => 5, 'auth_source' => 'platform', 'email' => 'efairbairn@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'efairbairn', 'pass' => 'efairbairn', 'firstname' => 'Elfstan', 'lastname' => 'Fairbairn', 'status' => 5, 'auth_source' => 'platform', 'email' => 'efairbairn@example.com', 'creator_id' => 1, 'active' => 1);
@ -196,7 +196,7 @@ $users[] = array('username' => 'obolger', 'pass'=> 'obolger', 'firstname' => 'Od
$users[] = array('username' => 'pbolger', 'pass'=> 'pbolger', 'firstname' => 'Prisca', 'lastname' => 'Bolger', 'status' => 5, 'auth_source' => 'platform', 'email' => 'pbolger@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'pbolger', 'pass'=> 'pbolger', 'firstname' => 'Prisca', 'lastname' => 'Bolger', 'status' => 5, 'auth_source' => 'platform', 'email' => 'pbolger@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'rgardner', 'pass'=> 'rgardner', 'firstname' => 'Ruby', 'lastname' => 'Gardner', 'status' => 5, 'auth_source' => 'platform', 'email' => 'rgardner@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'rgardner', 'pass'=> 'rgardner', 'firstname' => 'Ruby', 'lastname' => 'Gardner', 'status' => 5, 'auth_source' => 'platform', 'email' => 'rgardner@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'stook', 'pass'=> 'stook', 'firstname' => 'Sigismond', 'lastname' => 'Took', 'status' => 5, 'auth_source' => 'platform', 'email' => 'stook@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'stook', 'pass'=> 'stook', 'firstname' => 'Sigismond', 'lastname' => 'Took', 'status' => 5, 'auth_source' => 'platform', 'email' => 'stook@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'sgollum', 'pass'=> 'sgollum', 'firstname' => 'Sméagol', 'lastname' => 'Gollum', 'status' => 5, 'auth_source' => 'platform', 'email' => 'sgollum@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'sgollum', 'pass'=> 'sgollum', 'firstname' => 'Smeagol', 'lastname' => 'Gollum', 'status' => 5, 'auth_source' => 'platform', 'email' => 'sgollum@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'tsandyman', 'pass'=> 'tsandyman', 'firstname' => 'Ted', 'lastname' => 'Sandyman', 'status' => 5, 'auth_source' => 'platform', 'email' => 'tsandyman@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'tsandyman', 'pass'=> 'tsandyman', 'firstname' => 'Ted', 'lastname' => 'Sandyman', 'status' => 5, 'auth_source' => 'platform', 'email' => 'tsandyman@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'wgamwich', 'pass'=> 'wgamwich', 'firstname' => 'Wiseman', 'lastname' => 'Gamwich', 'status' => 5, 'auth_source' => 'platform', 'email' => 'wgamwich@example.com', 'creator_id' => 1, 'active' => 1); $users[] = array('username' => 'wgamwich', 'pass'=> 'wgamwich', 'firstname' => 'Wiseman', 'lastname' => 'Gamwich', 'status' => 5, 'auth_source' => 'platform', 'email' => 'wgamwich@example.com', 'creator_id' => 1, 'active' => 1);

@ -3,6 +3,7 @@
use Behat\Behat\Context\ClosuredContextInterface, use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\TranslatedContextInterface, Behat\Behat\Context\TranslatedContextInterface,
Behat\Behat\Context\BehatContext, Behat\Behat\Context\BehatContext,
Behat\Behat\Context\Step\Given,
Behat\Behat\Exception\PendingException; Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode, use Behat\Gherkin\Node\PyStringNode,
@ -38,11 +39,99 @@ class FeatureContext extends MinkContext
public function iAmAPlatformAdministrator() public function iAmAPlatformAdministrator()
{ {
return array( return array(
new \Behat\Behat\Context\Step\Given('I am on homepage'), new Given('I am on "/index.php?logout=logout"'),
new \Behat\Behat\Context\Step\Given('I fill in "login" with "admin"'), new Given('I am on homepage'),
new \Behat\Behat\Context\Step\Given('I fill in "password" with "admin"'), new Given('I fill in "login" with "admin"'),
new \Behat\Behat\Context\Step\Given('I press "submitAuth"') new Given('I fill in "password" with "admin"'),
new Given('I press "submitAuth"')
);
}
/**
* @Given /^Test users exist$/
*/
public function testUsersExist()
{
return array(
new Given('I am a platform administrator'),
new Given('I am on "/main/admin/filler.php?fill=users"')
);
}
/**
* @Given /^I am a session administrator$/
*/
public function iAmASessionAdministrator()
{
return array(
new Given('I am on "/index.php?logout=logout"'),
new Given('I am on homepage'),
new Given('I fill in "login" with "amaurichard"'),
new Given('I fill in "password" with "amaurichard"'),
new Given('I press "submitAuth"')
);
}
/**
* @Given /^I am a teacher$/
*/
public function iAmATeacher()
{
return array(
new Given('I am on "/index.php?logout=logout"'),
new Given('I am on homepage'),
new Given('I fill in "login" with "mmosquera"'),
new Given('I fill in "password" with "mmosquera"'),
new Given('I press "submitAuth"')
);
}
/**
* @Given /^I am a student$/
*/
public function iAmAStudent()
{
return array(
new Given('I am on "/index.php?logout=logout"'),
new Given('I am on homepage'),
new Given('I fill in "login" with "mbrandybuck"'),
new Given('I fill in "password" with "mbrandybuck"'),
new Given('I press "submitAuth"')
);
}
/**
* @Given /^I am an HR manager$/
*/
public function iAmAnHR()
{
return array(
new Given('I am on "/index.php?logout=logout"'),
new Given('I am on homepage'),
new Given('I fill in "login" with "ptook"'),
new Given('I fill in "password" with "ptook"'),
new Given('I press "submitAuth"')
);
}
/**
* @Given /^I am a student boss$/
*/
public function iAmAStudentBoss()
{
return array(
new Given('I am on "/index.php?logout=logout"'),
new Given('I am on homepage'),
new Given('I fill in "login" with "abaggins"'),
new Given('I fill in "password" with "abaggins"'),
new Given('I press "submitAuth"')
);
}
/**
* @Given /^I am an invitee$/
*/
public function iAmAnInvitee()
{
return array(
new Given('I am on "/index.php?logout=logout"'),
new Given('I am on homepage'),
new Given('I fill in "login" with "bproudfoot"'),
new Given('I fill in "password" with "bproudfoot"'),
new Given('I press "submitAuth"')
); );
} }
} }

Loading…
Cancel
Save