File: 03plugin_objects.t

package info (click to toggle)
request-tracker5 5.0.3%2Bdfsg-3~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 77,648 kB
  • sloc: javascript: 187,930; perl: 79,061; sh: 1,302; makefile: 471; python: 37; php: 15
file content (33 lines) | stat: -rw-r--r-- 1,055 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use strict;
use warnings;

use Test::Deep;
use RT::Test::Shredder tests => undef;
my $test = "RT::Test::Shredder";

use_ok('RT::Shredder::Plugin::Objects');

$test->create_savepoint('clean');

diag "Shred a queue whose name contains a hyphen";
{
    my $queue = RT::Test->load_or_create_queue( Name => 'it-support' );
    ok( $queue->id, 'created queue' );
    my $plugin = RT::Shredder::Plugin::Objects->new;
    my ( $status, $msg ) = $plugin->TestArgs( Queue => 'it-support' );
    ok( $status, "plugin arguments are ok" ) or diag "error: $msg";

    my $shredder = $test->shredder_new();

    ( $status, my @objs ) = $plugin->Run;
    ok( $status, "executed plugin successfully" );
    is( scalar @objs,   1,            'found one queue' );
    is( $objs[0]->Name, 'it-support', 'found the queue' );

    $shredder->PutObjects( Objects => [ 'RT::Queue-' . RT->Config->Get('Organization') . '-it-support' ] );
    $shredder->WipeoutAll;

    cmp_deeply( $test->dump_current_and_savepoint('clean'), "current DB equal to savepoint" );
}

done_testing();