8 my $schema = DBICTest->init_schema();
10 # this test will check to see if you can have 2 columns
11 # in the same class pointing at the same other class
15 # +---------+ +--------------+
16 # | SelfRef | | SelfRefAlias |
17 # +---------+ 1-M +--------------+
18 # | id |-------| self_ref | --+
19 # | name | | alias | --+
20 # +---------+ +--------------+ |
23 # +--------------------------------+
25 # see http://use.perl.org/~LTjake/journal/24876 for the
30 my $item = $schema->resultset("SelfRef")->find( 1 );
31 is( $item->name, 'First', 'proper start item' );
33 my @aliases = $item->aliases;
35 is( scalar @aliases, 1, 'proper number of aliases' );
37 my $orig = $aliases[ 0 ]->self_ref;
38 my $alias = $aliases[ 0 ]->alias;
40 is( $orig->name, 'First', 'proper original' );
41 is( $alias->name, 'Second', 'proper alias' );