8 # set up and populate schema
9 ok(my $schema = DBICTest->init_schema(), 'got schema');
12 my $artist_rs = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->display();
13 is_deeply($artist_rs, [
16 'name' => 'Caterwauler McCrae'
20 'name' => 'Random Boy Band'
24 'name' => 'We Are Goth'
26 ], 'ordered display returned as expected');
30 my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr_multi->display();
34 'name' => 'Caterwauler McCrae',
40 'name' => 'Random Boy Band',
46 'name' => 'We Are Goth',
50 ], 'display with substring using _with_meta_hash okay');
54 my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr_key->display();
58 'name' => 'Caterwauler McCrae',
63 'name' => 'Random Boy Band',
68 'name' => 'We Are Goth',
71 ], 'display with substring using _with_meta_key okay');
75 my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr_key_obj->display();
79 'name' => 'Caterwauler McCrae',
84 'name' => 'Random Boy Band',
89 'name' => 'We Are Goth',
92 ], 'display with substring using _with_meta_key with object okay');
96 # my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr_old->display();
97 # is_deeply($artists, [
100 # 'name' => 'Caterwauler McCrae',
105 # 'name' => 'Random Boy Band',
110 # 'name' => 'We Are Goth',
113 # ], 'display with substring okay');
117 my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr_key->search({}, { prefetch => 'cds', rows => 1 })->display();
118 is_deeply($artists, [
125 'title' => 'Caterwaulin\' Blues',
131 'title' => 'Spoonful of bees',
137 'title' => 'Forkful of bees',
141 'name' => 'Caterwauler McCrae',
144 ], 'substring before prefetch okay');