Added users fixture set
This commit is contained in:
parent
df7f1de1a6
commit
cc046f517b
21 changed files with 296 additions and 0 deletions
97
t/etc/fixtures/config/users.pl
Normal file
97
t/etc/fixtures/config/users.pl
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
#! /usr/bin/env perl
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use DBIx::Class::Fixtures;
|
||||||
|
use FindBin qw/ $Bin /;
|
||||||
|
use lib "$Bin/../../../../lib";
|
||||||
|
use Pear::LocalLoop::Schema;
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
my $fixtures = DBIx::Class::Fixtures->new({
|
||||||
|
config_dir => "$Bin",
|
||||||
|
});
|
||||||
|
|
||||||
|
my $schema = Pear::LocalLoop::Schema->connect('dbi:SQLite::memory:');
|
||||||
|
|
||||||
|
$schema->deploy;
|
||||||
|
|
||||||
|
$schema->resultset('Leaderboard')->populate([
|
||||||
|
[ qw/ name type / ],
|
||||||
|
[ 'Daily Total', 'daily_total' ],
|
||||||
|
[ 'Daily Count', 'daily_count' ],
|
||||||
|
[ 'Weekly Total', 'weekly_total' ],
|
||||||
|
[ 'Weekly Count', 'weekly_count' ],
|
||||||
|
[ 'Monthly Total', 'monthly_total' ],
|
||||||
|
[ 'Monthly Count', 'monthly_count' ],
|
||||||
|
[ 'All Time Total', 'all_time_total' ],
|
||||||
|
[ 'All Time Count', 'all_time_count' ],
|
||||||
|
]);
|
||||||
|
|
||||||
|
my $user1 = {
|
||||||
|
customer => {
|
||||||
|
full_name => 'Test User1',
|
||||||
|
display_name => 'Test User1',
|
||||||
|
postcode => 'LA1 1AA',
|
||||||
|
year_of_birth => 2006,
|
||||||
|
},
|
||||||
|
email => 'test1@example.com',
|
||||||
|
password => 'abc123',
|
||||||
|
};
|
||||||
|
|
||||||
|
my $user2 = {
|
||||||
|
customer => {
|
||||||
|
full_name => 'Test User2',
|
||||||
|
display_name => 'Test User2',
|
||||||
|
postcode => 'LA1 1AA',
|
||||||
|
year_of_birth => 2006,
|
||||||
|
},
|
||||||
|
email => 'test2@example.com',
|
||||||
|
password => 'abc123',
|
||||||
|
};
|
||||||
|
|
||||||
|
my $user3 = {
|
||||||
|
customer => {
|
||||||
|
full_name => 'Test User3',
|
||||||
|
display_name => 'Test User3',
|
||||||
|
postcode => 'LA1 1AA',
|
||||||
|
year_of_birth => 2006,
|
||||||
|
},
|
||||||
|
email => 'test3@example.com',
|
||||||
|
password => 'abc123',
|
||||||
|
};
|
||||||
|
|
||||||
|
my $user4 = {
|
||||||
|
customer => {
|
||||||
|
full_name => 'Test User4',
|
||||||
|
display_name => 'Test User4',
|
||||||
|
postcode => 'LA1 1AA',
|
||||||
|
year_of_birth => 2006,
|
||||||
|
},
|
||||||
|
email => 'test4@example.com',
|
||||||
|
password => 'abc123',
|
||||||
|
};
|
||||||
|
|
||||||
|
my $org = {
|
||||||
|
organisation => {
|
||||||
|
name => 'Test Org',
|
||||||
|
street_name => 'Test Street',
|
||||||
|
town => 'Lancaster',
|
||||||
|
postcode => 'LA1 1AA',
|
||||||
|
},
|
||||||
|
email => 'org@example.com',
|
||||||
|
password => 'abc123',
|
||||||
|
};
|
||||||
|
|
||||||
|
$schema->resultset('User')->create( $_ )
|
||||||
|
for ( $user1, $user2, $user3, $user4, $org );
|
||||||
|
|
||||||
|
my $data_set = 'users';
|
||||||
|
|
||||||
|
$fixtures->dump({
|
||||||
|
all => 1,
|
||||||
|
schema => $schema,
|
||||||
|
directory => "$Bin/../data/" . $data_set,
|
||||||
|
});
|
||||||
|
|
65
t/etc/fixtures/data/users/_config_set
Normal file
65
t/etc/fixtures/data/users/_config_set
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
$VAR1 = {
|
||||||
|
'has_many' => {
|
||||||
|
'fetch' => 0
|
||||||
|
},
|
||||||
|
'belongs_to' => {
|
||||||
|
'fetch' => 0
|
||||||
|
},
|
||||||
|
'might_have' => {
|
||||||
|
'fetch' => 0
|
||||||
|
},
|
||||||
|
'sets' => [
|
||||||
|
{
|
||||||
|
'class' => 'Leaderboard',
|
||||||
|
'quantity' => 'all'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'class' => 'AccountToken',
|
||||||
|
'quantity' => 'all'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'class' => 'LeaderboardValue',
|
||||||
|
'quantity' => 'all'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'quantity' => 'all',
|
||||||
|
'class' => 'SessionToken'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'class' => 'Administrator',
|
||||||
|
'quantity' => 'all'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'class' => 'LeaderboardSet',
|
||||||
|
'quantity' => 'all'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'quantity' => 'all',
|
||||||
|
'class' => 'Feedback'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'class' => 'PendingOrganisation',
|
||||||
|
'quantity' => 'all'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'class' => 'User',
|
||||||
|
'quantity' => 'all'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'class' => 'Transaction',
|
||||||
|
'quantity' => 'all'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'quantity' => 'all',
|
||||||
|
'class' => 'Organisation'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'quantity' => 'all',
|
||||||
|
'class' => 'Customer'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'quantity' => 'all',
|
||||||
|
'class' => 'PendingTransaction'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
1
t/etc/fixtures/data/users/_dumper_version
Normal file
1
t/etc/fixtures/data/users/_dumper_version
Normal file
|
@ -0,0 +1 @@
|
||||||
|
1.001036
|
7
t/etc/fixtures/data/users/customers/1.fix
Normal file
7
t/etc/fixtures/data/users/customers/1.fix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
$HASH1 = {
|
||||||
|
display_name => 'Test User1',
|
||||||
|
full_name => 'Test User1',
|
||||||
|
id => 1,
|
||||||
|
postcode => 'LA1 1AA',
|
||||||
|
year_of_birth => 2006
|
||||||
|
};
|
7
t/etc/fixtures/data/users/customers/2.fix
Normal file
7
t/etc/fixtures/data/users/customers/2.fix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
$HASH1 = {
|
||||||
|
display_name => 'Test User2',
|
||||||
|
full_name => 'Test User2',
|
||||||
|
id => 2,
|
||||||
|
postcode => 'LA1 1AA',
|
||||||
|
year_of_birth => 2006
|
||||||
|
};
|
7
t/etc/fixtures/data/users/customers/3.fix
Normal file
7
t/etc/fixtures/data/users/customers/3.fix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
$HASH1 = {
|
||||||
|
display_name => 'Test User3',
|
||||||
|
full_name => 'Test User3',
|
||||||
|
id => 3,
|
||||||
|
postcode => 'LA1 1AA',
|
||||||
|
year_of_birth => 2006
|
||||||
|
};
|
7
t/etc/fixtures/data/users/customers/4.fix
Normal file
7
t/etc/fixtures/data/users/customers/4.fix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
$HASH1 = {
|
||||||
|
display_name => 'Test User4',
|
||||||
|
full_name => 'Test User4',
|
||||||
|
id => 4,
|
||||||
|
postcode => 'LA1 1AA',
|
||||||
|
year_of_birth => 2006
|
||||||
|
};
|
5
t/etc/fixtures/data/users/leaderboards/1.fix
Normal file
5
t/etc/fixtures/data/users/leaderboards/1.fix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 1,
|
||||||
|
name => 'Daily Total',
|
||||||
|
type => 'daily_total'
|
||||||
|
};
|
5
t/etc/fixtures/data/users/leaderboards/2.fix
Normal file
5
t/etc/fixtures/data/users/leaderboards/2.fix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 2,
|
||||||
|
name => 'Daily Count',
|
||||||
|
type => 'daily_count'
|
||||||
|
};
|
5
t/etc/fixtures/data/users/leaderboards/3.fix
Normal file
5
t/etc/fixtures/data/users/leaderboards/3.fix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 3,
|
||||||
|
name => 'Weekly Total',
|
||||||
|
type => 'weekly_total'
|
||||||
|
};
|
5
t/etc/fixtures/data/users/leaderboards/4.fix
Normal file
5
t/etc/fixtures/data/users/leaderboards/4.fix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 4,
|
||||||
|
name => 'Weekly Count',
|
||||||
|
type => 'weekly_count'
|
||||||
|
};
|
5
t/etc/fixtures/data/users/leaderboards/5.fix
Normal file
5
t/etc/fixtures/data/users/leaderboards/5.fix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 5,
|
||||||
|
name => 'Monthly Total',
|
||||||
|
type => 'monthly_total'
|
||||||
|
};
|
5
t/etc/fixtures/data/users/leaderboards/6.fix
Normal file
5
t/etc/fixtures/data/users/leaderboards/6.fix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 6,
|
||||||
|
name => 'Monthly Count',
|
||||||
|
type => 'monthly_count'
|
||||||
|
};
|
5
t/etc/fixtures/data/users/leaderboards/7.fix
Normal file
5
t/etc/fixtures/data/users/leaderboards/7.fix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 7,
|
||||||
|
name => 'All Time Total',
|
||||||
|
type => 'all_time_total'
|
||||||
|
};
|
5
t/etc/fixtures/data/users/leaderboards/8.fix
Normal file
5
t/etc/fixtures/data/users/leaderboards/8.fix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 8,
|
||||||
|
name => 'All Time Count',
|
||||||
|
type => 'all_time_count'
|
||||||
|
};
|
10
t/etc/fixtures/data/users/organisations/1.fix
Normal file
10
t/etc/fixtures/data/users/organisations/1.fix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 1,
|
||||||
|
name => 'Test Org',
|
||||||
|
postcode
|
||||||
|
=> 'LA1 1AA',
|
||||||
|
sector => undef,
|
||||||
|
street_name
|
||||||
|
=> 'Test Street',
|
||||||
|
town => 'Lancaster'
|
||||||
|
};
|
11
t/etc/fixtures/data/users/users/1.fix
Normal file
11
t/etc/fixtures/data/users/users/1.fix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
$HASH1 = {
|
||||||
|
customer_id
|
||||||
|
=> 1,
|
||||||
|
email => 'test1@example.com',
|
||||||
|
id => 1,
|
||||||
|
join_date
|
||||||
|
=> '2017-08-25 15:36:11',
|
||||||
|
organisation_id
|
||||||
|
=> undef,
|
||||||
|
password => '$2a$08$yCau6xDkRFZINg80iVvMh.M3JnLq2g.LJ7GMJL5KQvO45pDL.D/Rq'
|
||||||
|
};
|
11
t/etc/fixtures/data/users/users/2.fix
Normal file
11
t/etc/fixtures/data/users/users/2.fix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
$HASH1 = {
|
||||||
|
customer_id
|
||||||
|
=> 2,
|
||||||
|
email => 'test2@example.com',
|
||||||
|
id => 2,
|
||||||
|
join_date
|
||||||
|
=> '2017-08-25 15:36:11',
|
||||||
|
organisation_id
|
||||||
|
=> undef,
|
||||||
|
password => '$2a$08$BZAsbHSW8TN/jlL2DFGDoeKFRKzj2dQTBwatxb0p/maefEcWcziom'
|
||||||
|
};
|
11
t/etc/fixtures/data/users/users/3.fix
Normal file
11
t/etc/fixtures/data/users/users/3.fix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
$HASH1 = {
|
||||||
|
customer_id
|
||||||
|
=> 3,
|
||||||
|
email => 'test3@example.com',
|
||||||
|
id => 3,
|
||||||
|
join_date
|
||||||
|
=> '2017-08-25 15:36:11',
|
||||||
|
organisation_id
|
||||||
|
=> undef,
|
||||||
|
password => '$2a$08$xdkD/OA5izrOX9cvJDa4i..8T3YGmfVSo/G87wDRoGWnQmlC0gxOW'
|
||||||
|
};
|
11
t/etc/fixtures/data/users/users/4.fix
Normal file
11
t/etc/fixtures/data/users/users/4.fix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
$HASH1 = {
|
||||||
|
customer_id
|
||||||
|
=> 4,
|
||||||
|
email => 'test4@example.com',
|
||||||
|
id => 4,
|
||||||
|
join_date
|
||||||
|
=> '2017-08-25 15:36:11',
|
||||||
|
organisation_id
|
||||||
|
=> undef,
|
||||||
|
password => '$2a$08$svjdm.Syn3f062pDIN3/ROTUU7W16n0zJFm9/sm3x7pfbMLZFV.5G'
|
||||||
|
};
|
11
t/etc/fixtures/data/users/users/5.fix
Normal file
11
t/etc/fixtures/data/users/users/5.fix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
$HASH1 = {
|
||||||
|
customer_id
|
||||||
|
=> undef,
|
||||||
|
email => 'org@example.com',
|
||||||
|
id => 5,
|
||||||
|
join_date
|
||||||
|
=> '2017-08-25 15:36:11',
|
||||||
|
organisation_id
|
||||||
|
=> 1,
|
||||||
|
password => '$2a$08$3PkZF7D9FiOq8hgU7cJ6puY86Fkl34bQj6dZeJRXPU8hhJIMZtge2'
|
||||||
|
};
|
Reference in a new issue