Added new search data fixtures
This commit is contained in:
parent
bf16077b10
commit
1ab2d0b71c
39 changed files with 414 additions and 0 deletions
88
t/etc/fixtures/config/search.pl
Normal file
88
t/etc/fixtures/config/search.pl
Normal file
|
@ -0,0 +1,88 @@
|
|||
#! /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;
|
||||
|
||||
$fixtures->populate({
|
||||
directory => "$Bin/../data/users",
|
||||
no_deploy => 1,
|
||||
schema => $schema,
|
||||
});
|
||||
|
||||
my @orgs = (
|
||||
{
|
||||
organisation => {
|
||||
name => 'Avanti Bar & Restaurant',
|
||||
street_name => '57 Main St',
|
||||
town => 'Kirkby Lonsdale',
|
||||
postcode => 'LA6 2AH',
|
||||
sector => 'I',
|
||||
},
|
||||
type => "organisation",
|
||||
},
|
||||
{
|
||||
organisation => {
|
||||
name => 'Full House Noodle Bar',
|
||||
street_name => '21 Common Garden St',
|
||||
town => 'Lancaster',
|
||||
postcode => 'LA1 1XD',
|
||||
sector => 'I',
|
||||
},
|
||||
type => "organisation",
|
||||
},
|
||||
{
|
||||
organisation => {
|
||||
name => 'The Quay\'s Fishbar',
|
||||
street_name => '1 Adcliffe Rd',
|
||||
town => 'Lancaster',
|
||||
postcode => 'LA1 1SS',
|
||||
sector => 'I',
|
||||
},
|
||||
type => "organisation",
|
||||
},
|
||||
{
|
||||
organisation => {
|
||||
name => 'Dan\'s Fishop',
|
||||
street_name => '56 North Rd',
|
||||
town => 'Lancaster',
|
||||
postcode => 'LA1 1LT',
|
||||
sector => 'I',
|
||||
},
|
||||
type => "organisation",
|
||||
},
|
||||
{
|
||||
organisation => {
|
||||
name => 'Hodgeson\'s Chippy',
|
||||
street_name => '96 Prospect St',
|
||||
town => 'Lancaster',
|
||||
postcode => 'LA1 3BH',
|
||||
sector => 'I',
|
||||
},
|
||||
type => "organisation",
|
||||
},
|
||||
);
|
||||
|
||||
$schema->resultset('Entity')->create( $_ ) for @orgs;
|
||||
|
||||
my $data_set = 'search';
|
||||
|
||||
$fixtures->dump({
|
||||
all => 1,
|
||||
schema => $schema,
|
||||
directory => "$Bin/../data/" . $data_set,
|
||||
});
|
||||
|
57
t/etc/fixtures/data/search/_config_set
Normal file
57
t/etc/fixtures/data/search/_config_set
Normal file
|
@ -0,0 +1,57 @@
|
|||
$VAR1 = {
|
||||
'has_many' => {
|
||||
'fetch' => 0
|
||||
},
|
||||
'sets' => [
|
||||
{
|
||||
'class' => 'Feedback',
|
||||
'quantity' => 'all'
|
||||
},
|
||||
{
|
||||
'quantity' => 'all',
|
||||
'class' => 'Transaction'
|
||||
},
|
||||
{
|
||||
'quantity' => 'all',
|
||||
'class' => 'User'
|
||||
},
|
||||
{
|
||||
'quantity' => 'all',
|
||||
'class' => 'LeaderboardSet'
|
||||
},
|
||||
{
|
||||
'class' => 'Customer',
|
||||
'quantity' => 'all'
|
||||
},
|
||||
{
|
||||
'quantity' => 'all',
|
||||
'class' => 'Organisation'
|
||||
},
|
||||
{
|
||||
'quantity' => 'all',
|
||||
'class' => 'LeaderboardValue'
|
||||
},
|
||||
{
|
||||
'class' => 'Entity',
|
||||
'quantity' => 'all'
|
||||
},
|
||||
{
|
||||
'quantity' => 'all',
|
||||
'class' => 'Leaderboard'
|
||||
},
|
||||
{
|
||||
'class' => 'SessionToken',
|
||||
'quantity' => 'all'
|
||||
},
|
||||
{
|
||||
'quantity' => 'all',
|
||||
'class' => 'AccountToken'
|
||||
}
|
||||
],
|
||||
'might_have' => {
|
||||
'fetch' => 0
|
||||
},
|
||||
'belongs_to' => {
|
||||
'fetch' => 0
|
||||
}
|
||||
};
|
1
t/etc/fixtures/data/search/_dumper_version
Normal file
1
t/etc/fixtures/data/search/_dumper_version
Normal file
|
@ -0,0 +1 @@
|
|||
1.001036
|
8
t/etc/fixtures/data/search/customers/1.fix
Normal file
8
t/etc/fixtures/data/search/customers/1.fix
Normal file
|
@ -0,0 +1,8 @@
|
|||
$HASH1 = {
|
||||
display_name => 'Test User1',
|
||||
entity_id => 1,
|
||||
full_name => 'Test User1',
|
||||
id => 1,
|
||||
postcode => 'LA1 1AA',
|
||||
year_of_birth => 2006
|
||||
};
|
8
t/etc/fixtures/data/search/customers/2.fix
Normal file
8
t/etc/fixtures/data/search/customers/2.fix
Normal file
|
@ -0,0 +1,8 @@
|
|||
$HASH1 = {
|
||||
display_name => 'Test User2',
|
||||
entity_id => 2,
|
||||
full_name => 'Test User2',
|
||||
id => 2,
|
||||
postcode => 'LA1 1AA',
|
||||
year_of_birth => 2006
|
||||
};
|
8
t/etc/fixtures/data/search/customers/3.fix
Normal file
8
t/etc/fixtures/data/search/customers/3.fix
Normal file
|
@ -0,0 +1,8 @@
|
|||
$HASH1 = {
|
||||
display_name => 'Test User3',
|
||||
entity_id => 3,
|
||||
full_name => 'Test User3',
|
||||
id => 3,
|
||||
postcode => 'LA1 1AA',
|
||||
year_of_birth => 2006
|
||||
};
|
8
t/etc/fixtures/data/search/customers/4.fix
Normal file
8
t/etc/fixtures/data/search/customers/4.fix
Normal file
|
@ -0,0 +1,8 @@
|
|||
$HASH1 = {
|
||||
display_name => 'Test User4',
|
||||
entity_id => 4,
|
||||
full_name => 'Test User4',
|
||||
id => 4,
|
||||
postcode => 'LA1 1AA',
|
||||
year_of_birth => 2006
|
||||
};
|
8
t/etc/fixtures/data/search/customers/5.fix
Normal file
8
t/etc/fixtures/data/search/customers/5.fix
Normal file
|
@ -0,0 +1,8 @@
|
|||
$HASH1 = {
|
||||
display_name => 'Test Admin',
|
||||
entity_id => 6,
|
||||
full_name => 'Test Admin',
|
||||
id => 5,
|
||||
postcode => 'LA1 1AA',
|
||||
year_of_birth => 2006
|
||||
};
|
4
t/etc/fixtures/data/search/entities/1.fix
Normal file
4
t/etc/fixtures/data/search/entities/1.fix
Normal file
|
@ -0,0 +1,4 @@
|
|||
$HASH1 = {
|
||||
id => 1,
|
||||
type => 'customer'
|
||||
};
|
4
t/etc/fixtures/data/search/entities/10.fix
Normal file
4
t/etc/fixtures/data/search/entities/10.fix
Normal file
|
@ -0,0 +1,4 @@
|
|||
$HASH1 = {
|
||||
id => 10,
|
||||
type => 'organisation'
|
||||
};
|
4
t/etc/fixtures/data/search/entities/11.fix
Normal file
4
t/etc/fixtures/data/search/entities/11.fix
Normal file
|
@ -0,0 +1,4 @@
|
|||
$HASH1 = {
|
||||
id => 11,
|
||||
type => 'organisation'
|
||||
};
|
4
t/etc/fixtures/data/search/entities/2.fix
Normal file
4
t/etc/fixtures/data/search/entities/2.fix
Normal file
|
@ -0,0 +1,4 @@
|
|||
$HASH1 = {
|
||||
id => 2,
|
||||
type => 'customer'
|
||||
};
|
4
t/etc/fixtures/data/search/entities/3.fix
Normal file
4
t/etc/fixtures/data/search/entities/3.fix
Normal file
|
@ -0,0 +1,4 @@
|
|||
$HASH1 = {
|
||||
id => 3,
|
||||
type => 'customer'
|
||||
};
|
4
t/etc/fixtures/data/search/entities/4.fix
Normal file
4
t/etc/fixtures/data/search/entities/4.fix
Normal file
|
@ -0,0 +1,4 @@
|
|||
$HASH1 = {
|
||||
id => 4,
|
||||
type => 'customer'
|
||||
};
|
4
t/etc/fixtures/data/search/entities/5.fix
Normal file
4
t/etc/fixtures/data/search/entities/5.fix
Normal file
|
@ -0,0 +1,4 @@
|
|||
$HASH1 = {
|
||||
id => 5,
|
||||
type => 'organisation'
|
||||
};
|
4
t/etc/fixtures/data/search/entities/6.fix
Normal file
4
t/etc/fixtures/data/search/entities/6.fix
Normal file
|
@ -0,0 +1,4 @@
|
|||
$HASH1 = {
|
||||
id => 6,
|
||||
type => 'customer'
|
||||
};
|
4
t/etc/fixtures/data/search/entities/7.fix
Normal file
4
t/etc/fixtures/data/search/entities/7.fix
Normal file
|
@ -0,0 +1,4 @@
|
|||
$HASH1 = {
|
||||
id => 7,
|
||||
type => 'organisation'
|
||||
};
|
4
t/etc/fixtures/data/search/entities/8.fix
Normal file
4
t/etc/fixtures/data/search/entities/8.fix
Normal file
|
@ -0,0 +1,4 @@
|
|||
$HASH1 = {
|
||||
id => 8,
|
||||
type => 'organisation'
|
||||
};
|
4
t/etc/fixtures/data/search/entities/9.fix
Normal file
4
t/etc/fixtures/data/search/entities/9.fix
Normal file
|
@ -0,0 +1,4 @@
|
|||
$HASH1 = {
|
||||
id => 9,
|
||||
type => 'organisation'
|
||||
};
|
5
t/etc/fixtures/data/search/leaderboards/1.fix
Normal file
5
t/etc/fixtures/data/search/leaderboards/1.fix
Normal file
|
@ -0,0 +1,5 @@
|
|||
$HASH1 = {
|
||||
id => 1,
|
||||
name => 'Daily Total',
|
||||
type => 'daily_total'
|
||||
};
|
5
t/etc/fixtures/data/search/leaderboards/2.fix
Normal file
5
t/etc/fixtures/data/search/leaderboards/2.fix
Normal file
|
@ -0,0 +1,5 @@
|
|||
$HASH1 = {
|
||||
id => 2,
|
||||
name => 'Daily Count',
|
||||
type => 'daily_count'
|
||||
};
|
5
t/etc/fixtures/data/search/leaderboards/3.fix
Normal file
5
t/etc/fixtures/data/search/leaderboards/3.fix
Normal file
|
@ -0,0 +1,5 @@
|
|||
$HASH1 = {
|
||||
id => 3,
|
||||
name => 'Weekly Total',
|
||||
type => 'weekly_total'
|
||||
};
|
5
t/etc/fixtures/data/search/leaderboards/4.fix
Normal file
5
t/etc/fixtures/data/search/leaderboards/4.fix
Normal file
|
@ -0,0 +1,5 @@
|
|||
$HASH1 = {
|
||||
id => 4,
|
||||
name => 'Weekly Count',
|
||||
type => 'weekly_count'
|
||||
};
|
5
t/etc/fixtures/data/search/leaderboards/5.fix
Normal file
5
t/etc/fixtures/data/search/leaderboards/5.fix
Normal file
|
@ -0,0 +1,5 @@
|
|||
$HASH1 = {
|
||||
id => 5,
|
||||
name => 'Monthly Total',
|
||||
type => 'monthly_total'
|
||||
};
|
5
t/etc/fixtures/data/search/leaderboards/6.fix
Normal file
5
t/etc/fixtures/data/search/leaderboards/6.fix
Normal file
|
@ -0,0 +1,5 @@
|
|||
$HASH1 = {
|
||||
id => 6,
|
||||
name => 'Monthly Count',
|
||||
type => 'monthly_count'
|
||||
};
|
5
t/etc/fixtures/data/search/leaderboards/7.fix
Normal file
5
t/etc/fixtures/data/search/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/search/leaderboards/8.fix
Normal file
5
t/etc/fixtures/data/search/leaderboards/8.fix
Normal file
|
@ -0,0 +1,5 @@
|
|||
$HASH1 = {
|
||||
id => 8,
|
||||
name => 'All Time Count',
|
||||
type => 'all_time_count'
|
||||
};
|
16
t/etc/fixtures/data/search/organisations/1.fix
Normal file
16
t/etc/fixtures/data/search/organisations/1.fix
Normal file
|
@ -0,0 +1,16 @@
|
|||
$HASH1 = {
|
||||
country => undef,
|
||||
entity_id
|
||||
=> 5,
|
||||
id => 1,
|
||||
name => 'Test Org',
|
||||
pending => 0,
|
||||
postcode
|
||||
=> 'LA1 1AA',
|
||||
sector => undef,
|
||||
street_name
|
||||
=> 'Test Street',
|
||||
submitted_by_id
|
||||
=> undef,
|
||||
town => 'Lancaster'
|
||||
};
|
16
t/etc/fixtures/data/search/organisations/2.fix
Normal file
16
t/etc/fixtures/data/search/organisations/2.fix
Normal file
|
@ -0,0 +1,16 @@
|
|||
$HASH1 = {
|
||||
country => undef,
|
||||
entity_id
|
||||
=> 7,
|
||||
id => 2,
|
||||
name => 'Avanti Bar & Restaurant',
|
||||
pending => 0,
|
||||
postcode
|
||||
=> 'LA6 2AH',
|
||||
sector => 'I',
|
||||
street_name
|
||||
=> '57 Main St',
|
||||
submitted_by_id
|
||||
=> undef,
|
||||
town => 'Kirkby Lonsdale'
|
||||
};
|
16
t/etc/fixtures/data/search/organisations/3.fix
Normal file
16
t/etc/fixtures/data/search/organisations/3.fix
Normal file
|
@ -0,0 +1,16 @@
|
|||
$HASH1 = {
|
||||
country => undef,
|
||||
entity_id
|
||||
=> 8,
|
||||
id => 3,
|
||||
name => 'Full House Noodle Bar',
|
||||
pending => 0,
|
||||
postcode
|
||||
=> 'LA1 1XD',
|
||||
sector => 'I',
|
||||
street_name
|
||||
=> '21 Common Garden St',
|
||||
submitted_by_id
|
||||
=> undef,
|
||||
town => 'Lancaster'
|
||||
};
|
16
t/etc/fixtures/data/search/organisations/4.fix
Normal file
16
t/etc/fixtures/data/search/organisations/4.fix
Normal file
|
@ -0,0 +1,16 @@
|
|||
$HASH1 = {
|
||||
country => undef,
|
||||
entity_id
|
||||
=> 9,
|
||||
id => 4,
|
||||
name => 'The Quay\'s Fishbar',
|
||||
pending => 0,
|
||||
postcode
|
||||
=> 'LA1 1SS',
|
||||
sector => 'I',
|
||||
street_name
|
||||
=> '1 Adcliffe Rd',
|
||||
submitted_by_id
|
||||
=> undef,
|
||||
town => 'Lancaster'
|
||||
};
|
16
t/etc/fixtures/data/search/organisations/5.fix
Normal file
16
t/etc/fixtures/data/search/organisations/5.fix
Normal file
|
@ -0,0 +1,16 @@
|
|||
$HASH1 = {
|
||||
country => undef,
|
||||
entity_id
|
||||
=> 10,
|
||||
id => 5,
|
||||
name => 'Dan\'s Fishop',
|
||||
pending => 0,
|
||||
postcode
|
||||
=> 'LA1 1LT',
|
||||
sector => 'I',
|
||||
street_name
|
||||
=> '56 North Rd',
|
||||
submitted_by_id
|
||||
=> undef,
|
||||
town => 'Lancaster'
|
||||
};
|
16
t/etc/fixtures/data/search/organisations/6.fix
Normal file
16
t/etc/fixtures/data/search/organisations/6.fix
Normal file
|
@ -0,0 +1,16 @@
|
|||
$HASH1 = {
|
||||
country => undef,
|
||||
entity_id
|
||||
=> 11,
|
||||
id => 6,
|
||||
name => 'Hodgeson\'s Chippy',
|
||||
pending => 0,
|
||||
postcode
|
||||
=> 'LA1 3BH',
|
||||
sector => 'I',
|
||||
street_name
|
||||
=> '96 Prospect St',
|
||||
submitted_by_id
|
||||
=> undef,
|
||||
town => 'Lancaster'
|
||||
};
|
8
t/etc/fixtures/data/search/users/1.fix
Normal file
8
t/etc/fixtures/data/search/users/1.fix
Normal file
|
@ -0,0 +1,8 @@
|
|||
$HASH1 = {
|
||||
email => 'test1@example.com',
|
||||
entity_id => 1,
|
||||
id => 1,
|
||||
is_admin => 0,
|
||||
join_date => '2017-08-31 12:17:25',
|
||||
password => '$2a$08$HSuznDeSU1fuONwKhp2/S.TX/X4p4g0dHtz20kVXxprm8hIg5QQma'
|
||||
};
|
8
t/etc/fixtures/data/search/users/2.fix
Normal file
8
t/etc/fixtures/data/search/users/2.fix
Normal file
|
@ -0,0 +1,8 @@
|
|||
$HASH1 = {
|
||||
email => 'test2@example.com',
|
||||
entity_id => 2,
|
||||
id => 2,
|
||||
is_admin => 0,
|
||||
join_date => '2017-08-31 12:17:25',
|
||||
password => '$2a$08$5XYLWPJvVGuWUvfSWj9cIOg4/tyB4fZ3knzwgw5UnBSKFBFIKOiFC'
|
||||
};
|
8
t/etc/fixtures/data/search/users/3.fix
Normal file
8
t/etc/fixtures/data/search/users/3.fix
Normal file
|
@ -0,0 +1,8 @@
|
|||
$HASH1 = {
|
||||
email => 'test3@example.com',
|
||||
entity_id => 3,
|
||||
id => 3,
|
||||
is_admin => 0,
|
||||
join_date => '2017-08-31 12:17:25',
|
||||
password => '$2a$08$p5VU4leHetEvuz2P3uMfYuuPTkDGg8wsM7QuSVKkXR.s3B9T2JaVW'
|
||||
};
|
8
t/etc/fixtures/data/search/users/4.fix
Normal file
8
t/etc/fixtures/data/search/users/4.fix
Normal file
|
@ -0,0 +1,8 @@
|
|||
$HASH1 = {
|
||||
email => 'test4@example.com',
|
||||
entity_id => 4,
|
||||
id => 4,
|
||||
is_admin => 0,
|
||||
join_date => '2017-08-31 12:17:25',
|
||||
password => '$2a$08$fkkTUYA9zvt32iBbN7aOcOnmiHzOkbMEjN31PB9CsitGrE.KF7cAG'
|
||||
};
|
8
t/etc/fixtures/data/search/users/5.fix
Normal file
8
t/etc/fixtures/data/search/users/5.fix
Normal file
|
@ -0,0 +1,8 @@
|
|||
$HASH1 = {
|
||||
email => 'org@example.com',
|
||||
entity_id => 5,
|
||||
id => 5,
|
||||
is_admin => 0,
|
||||
join_date => '2017-08-31 12:17:25',
|
||||
password => '$2a$08$MWC45.w1AnLPNNHiS96ICOHfNlTrIqB0.7OPzy5qB.z0pZB0theo.'
|
||||
};
|
8
t/etc/fixtures/data/search/users/6.fix
Normal file
8
t/etc/fixtures/data/search/users/6.fix
Normal file
|
@ -0,0 +1,8 @@
|
|||
$HASH1 = {
|
||||
email => 'admin@example.com',
|
||||
entity_id => 6,
|
||||
id => 6,
|
||||
is_admin => 1,
|
||||
join_date => '2017-08-31 12:17:25',
|
||||
password => '$2a$08$1sPcPB9GnoNgzhBAk2bHSOqEmv6.Y6YLrAa2DJ6TR2WefzTYZQ92G'
|
||||
};
|
Reference in a new issue