File: DBICTestLib.pm

package info (click to toggle)
libhtml-formfu-model-dbic-perl 0.06000-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,252 kB
  • ctags: 147
  • sloc: perl: 2,112; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 540 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package DBICTestLib;
use strict;
use warnings;

use DBI;

use base 'Exporter';

our @EXPORT_OK = qw/ new_schema /;

sub new_schema {
    my $schema = MySchema->connect('dbi:SQLite:dbname=:memory:');
    
    $schema->deploy;
    
    $schema->resultset('Type')->create({ id => 1, type => 'foo' });
    $schema->resultset('Type')->create({ id => 2, type => 'bar' });
    
    $schema->resultset('Type2')->create({ id => 1, type => 'foo' });
    $schema->resultset('Type2')->create({ id => 2, type => 'bar' });
    
    return $schema;
}

1;