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 :  /usr/share/doc/perl-DBIx-Class/t/debug/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/perl-DBIx-Class/t/debug/pretty.t
use strict;
use warnings;
use lib qw(t/lib);
use DBICTest;
use Test::More;

BEGIN {
    require DBIx::Class;
    plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_prettydebug')
      unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_prettydebug');
}

BEGIN { delete @ENV{qw(DBIC_TRACE_PROFILE)} }

{
   my $schema = DBICTest->init_schema;

   isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Statistics');
}

{
   local $ENV{DBIC_TRACE_PROFILE} = 'console';

   my $schema = DBICTest->init_schema;

   isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Debug::PrettyTrace');;
   is($schema->storage->debugobj->_sqlat->indent_string, ' ', 'indent string set correctly from console profile');
}

{
   local $ENV{DBIC_TRACE_PROFILE} = './t/lib/awesome.json';

   my $schema = DBICTest->init_schema;

   isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Debug::PrettyTrace');;
   is($schema->storage->debugobj->_sqlat->indent_string, 'frioux', 'indent string set correctly from file-based profile');
}

done_testing;

Hry