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/proc/self/root/usr/share/doc/perl-DBIx-Class/t/cdbi/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/self/root/usr/share/doc/perl-DBIx-Class/t/cdbi/construct.t
use strict;
use warnings;
use Test::More;

INIT {
    use lib 't/cdbi/testlib';
    use Film;
}

{
    Film->insert({
        Title     => "Breaking the Waves",
        Director  => 'Lars von Trier',
        Rating    => 'R'
    });

    my $film = Film->construct({
        Title     => "Breaking the Waves",
        Director  => 'Lars von Trier',
    });

    isa_ok $film, "Film";
    is $film->title,    "Breaking the Waves";
    is $film->director, "Lars von Trier";
    is $film->rating,   "R",
        "constructed objects can get missing data from the db";
}

{
    package Foo;
    use base qw(Film);
    Foo->columns( TEMP => qw(temp_thing) );
    my $film = Foo->construct({
        temp_thing  => 23
    });

    ::is $film->temp_thing, 23, "construct sets temp columns";
}

done_testing;

Hry