[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.3-40-g01d03b8

Alex Vandiver alexmv at bestpractical.com
Tue Nov 8 16:44:22 EST 2011


The branch, 4.0-trunk has been updated
       via  01d03b861cc1d9ed5065bfbd6ff442e7c07eaf4b (commit)
      from  14eb138a28a7372e0a639d78e2956f18f332db67 (commit)

Summary of changes:
 t/web/transaction_batch.t |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 01d03b861cc1d9ed5065bfbd6ff442e7c07eaf4b
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Nov 8 16:19:24 2011 -0500

    Warning avoidance during Create txn in TransactionBatch test
    
    The Create transaction of $ticket causes a pending transaction for
    TransactionBatch, which was not triggered until it passed out of scope
    during global destruction.  As the applicable check tests ->Field eq,
    and ->Field is undef on a Create transaction, this caused a warning.
    
    Flush the transaction earlier, explicitly, and warnings-proof the
    ->Field check.

diff --git a/t/web/transaction_batch.t b/t/web/transaction_batch.t
index c01b5f5..ae04e1f 100644
--- a/t/web/transaction_batch.t
+++ b/t/web/transaction_batch.t
@@ -10,7 +10,7 @@ my $s1 = RT::Scrip->new(RT->SystemUser);
 my ($val, $msg) =$s1->Create( Queue => $q->Id,
              ScripCondition    => 'User Defined',
              ScripAction       => 'User Defined',
-             CustomIsApplicableCode => 'return $self->TransactionObj->Field eq "TimeEstimated"',
+             CustomIsApplicableCode => 'return ($self->TransactionObj->Field||"") eq "TimeEstimated"',
              CustomPrepareCode => 'return 1',
              CustomCommitCode  => '$self->TicketObj->SetPriority($self->TicketObj->Priority + 2); return 1;',
              Template          => 'Blank',
@@ -24,6 +24,9 @@ my ($tv,$ttv,$tm) = $ticket->Create(Queue => $q->Id,
                                     );
 ok($tv, $tm);
 
+# Flush the Create transaction off of the ticket
+$ticket->ApplyTransactionBatch;
+
 my $testuser = RT::Test->load_or_create_user( Name => 'bob', EmailAddress => 'bob at example.com', Password => 'password' );
 ok($testuser->Id, "Created test user bob");
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list