File: storage-values.t

package info (click to toggle)
libdbix-class-helpers-perl 2.013002-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 420 kB
  • sloc: perl: 1,931; sql: 73; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!perl

use strict;
use warnings;

use lib 't/lib';
use Test::More;
use Test::Deep;

use TestSchema;
my $schema = TestSchema->deploy_or_connect();
$schema->prepopulate;

my $first = $schema->resultset('Bar')->search(undef, { order_by => 'id' })->first;

is($first->foo_id, 1, 'foo_id starts as 1');
is($first->get_storage_value('foo_id'), 1, 'foo_id storage value starts as 1');
$first->foo_id(2);
is($first->foo_id, 2, 'foo_id changes to 2');
is($first->get_storage_value('foo_id'), 1, 'foo_id storage value is still 1');
$first->update;
is($first->get_storage_value('foo_id'), 2, 'foo_id storage value is updated to 2');

done_testing;