"Fossies" - the Fresh Open Source Software Archive

Member "rt-5.0.2/t/shredder/01basics.t" (14 Sep 2021, 625 Bytes) of package /linux/misc/rt-5.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 
    2 use strict;
    3 use warnings;
    4 
    5 use Test::Deep;
    6 use RT::Test::Shredder tests => 4;
    7 my $test = "RT::Test::Shredder";
    8 
    9 $test->create_savepoint();
   10 
   11 use RT::Tickets;
   12 my $ticket = RT::Ticket->new( RT->SystemUser );
   13 my ($id) = $ticket->Create( Subject => 'test', Queue => 1 );
   14 ok( $id, "created new ticket" );
   15 
   16 $ticket = RT::Ticket->new( RT->SystemUser );
   17 my ($status, $msg) = $ticket->Load( $id );
   18 ok( $id, "load ticket" ) or diag( "error: $msg" );
   19 
   20 my $shredder = $test->shredder_new();
   21 $shredder->Wipeout( Object => $ticket );
   22 
   23 $test->db_is_valid;
   24 
   25 cmp_deeply( $test->dump_current_and_savepoint(), "current DB equal to savepoint");