Added users fixture set

This commit is contained in:
Tom Bloor 2017-08-25 16:36:43 +01:00
parent df7f1de1a6
commit cc046f517b
21 changed files with 296 additions and 0 deletions

View 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,
});

View 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'
}
]
};

View file

@ -0,0 +1 @@
1.001036

View file

@ -0,0 +1,7 @@
$HASH1 = {
display_name => 'Test User1',
full_name => 'Test User1',
id => 1,
postcode => 'LA1 1AA',
year_of_birth => 2006
};

View file

@ -0,0 +1,7 @@
$HASH1 = {
display_name => 'Test User2',
full_name => 'Test User2',
id => 2,
postcode => 'LA1 1AA',
year_of_birth => 2006
};

View file

@ -0,0 +1,7 @@
$HASH1 = {
display_name => 'Test User3',
full_name => 'Test User3',
id => 3,
postcode => 'LA1 1AA',
year_of_birth => 2006
};

View file

@ -0,0 +1,7 @@
$HASH1 = {
display_name => 'Test User4',
full_name => 'Test User4',
id => 4,
postcode => 'LA1 1AA',
year_of_birth => 2006
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 1,
name => 'Daily Total',
type => 'daily_total'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 2,
name => 'Daily Count',
type => 'daily_count'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 3,
name => 'Weekly Total',
type => 'weekly_total'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 4,
name => 'Weekly Count',
type => 'weekly_count'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 5,
name => 'Monthly Total',
type => 'monthly_total'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 6,
name => 'Monthly Count',
type => 'monthly_count'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 7,
name => 'All Time Total',
type => 'all_time_total'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 8,
name => 'All Time Count',
type => 'all_time_count'
};

View file

@ -0,0 +1,10 @@
$HASH1 = {
id => 1,
name => 'Test Org',
postcode
=> 'LA1 1AA',
sector => undef,
street_name
=> 'Test Street',
town => 'Lancaster'
};

View 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'
};

View 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'
};

View 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'
};

View 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'
};

View 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'
};