Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/self/root/usr/share/doc/perl-DBIx-Class/t/search/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/share/doc/perl-DBIx-Class/t/search/deprecated_attributes.t
use strict;
use warnings;

use Test::More;
use Test::Warn;
use lib qw(t/lib);
use DBICTest;

my $schema = DBICTest->init_schema();

my $cd_rs = $schema->resultset("CD")->search({ 'me.cdid' => 1 });

warnings_exist( sub {
  my $cd = $cd_rs->search( undef, {
    cols => [ { name => 'artist.name' } ],
    join => 'artist',
  })->next;

  is_deeply (
    { $cd->get_inflated_columns },
    { name => 'Caterwauler McCrae' },
    'cols attribute still works',
  );
}, qr/Resultset attribute 'cols' is deprecated/,
'deprecation warning when passing cols attribute');

warnings_exist( sub {
  my $cd = $cd_rs->search_rs( undef, {
    include_columns => [ { name => 'artist.name' } ],
    join => 'artist',
  })->next;

  is (
    $cd->get_column('name'),
    'Caterwauler McCrae',
    'include_columns attribute still works',
  );
}, qr/Resultset attribute 'include_columns' is deprecated/,
'deprecation warning when passing include_columns attribute');

done_testing;

Hry