StoredHash

 view release on metacpan or  search on metacpan

t/05isa.t  view on Meta::CPAN



# Local Persister Config WITH class / blessing info
# Keep to prepopulate DB
my $shpc = {'table' => 'anim', 'pkey' => ['id'], 'class' => 'Animal', 'dbh' => $dbh};
# OR (Use Animal inherited persistance):
$Animal::shp->{'dbh'} = $dbh;
# TODO: Create reference file anim_data.pl to be used for population AND deep compare
# Create this statically with features of 03selects.t
#LOAD:
my $animarr = require("anim_data.pl");
ok(ref($animarr), "Got Animal data (Perl)");
my $icnt = scalar(@$animarr);
my $ocnt = scalar( grep({ref($_) eq 'HASH';} @$animarr) );
ok($ocnt == $icnt, "All ($icnt) are Hashes"); # Check all are hashes
# BLESS: ?
map({bless($_, 'Animal');} @$animarr);
my $bcnt = scalar( grep({blessed($_) eq 'Animal';} @$animarr) );
ok($bcnt == $icnt, "All ($icnt) are Animal after blessing collection.");
#DEBUG:print(Dumper($animarr));exit(0);
# Use local persister OR Animal class-method ? Or instance method ?



( run in 0.492 second using v1.01-cache-2.11-cpan-0d8aa00de5b )