diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-07-02 21:11:29 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-07-02 21:11:29 -0700 |
commit | 3d0a1bb06b895c5be6e3f0517d355442a6b1e125 (patch) | |
tree | 84069ebc3254825b952a482e11cdbbbc69f6fe85 /rt/t/customfields/api.t | |
parent | f3b99c11d6eed33f467dda360180a698a85c54e8 (diff) | |
parent | d62206a94d9d49ef96640e0a8ec492679f8345e9 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'rt/t/customfields/api.t')
-rw-r--r-- | rt/t/customfields/api.t | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/rt/t/customfields/api.t b/rt/t/customfields/api.t index d739a572d..2e1c07986 100644 --- a/rt/t/customfields/api.t +++ b/rt/t/customfields/api.t @@ -1,9 +1,9 @@ -#!/usr/bin/perl use strict; use warnings FATAL => 'all'; -use RT::Test nodata => 1, tests => 139; +use RT::Test nodata => 1, tests => 145; +use Test::Warn; # Before we get going, ditch all object_cfs; this will remove # all custom fields systemwide; @@ -69,13 +69,21 @@ is( $cfvs->Count, 0 ); is( $ticket->FirstCustomFieldValue, undef ); # CF with ID -1 shouldnt exist at all -$cfvs = $ticket->CustomFieldValues( -1 ); +warning_like { + $cfvs = $ticket->CustomFieldValues( -1 ); +} qr{Couldn't load custom field}; is( $cfvs->Count, 0 ); -is( $ticket->FirstCustomFieldValue( -1 ), undef ); +warning_like { + is( $ticket->FirstCustomFieldValue( -1 ), undef ); +} qr{Couldn't load custom field}; -$cfvs = $ticket->CustomFieldValues( 'SomeUnexpedCustomFieldName' ); +warning_like { + $cfvs = $ticket->CustomFieldValues( 'SomeUnexpedCustomFieldName' ); +} qr{Couldn't load custom field}; is( $cfvs->Count, 0 ); -is( $ticket->FirstCustomFieldValue( 'SomeUnexpedCustomFieldName' ), undef ); +warning_like { + is( $ticket->FirstCustomFieldValue( 'SomeUnexpedCustomFieldName' ), undef ); +} qr{Couldn't load custom field}; for (@custom_fields) { $cfvs = $ticket->CustomFieldValues( $_->id ); @@ -183,9 +191,13 @@ $test_add_delete_cycle->( sub { return $_[0] } ); $ticket->AddCustomFieldValue( Field => $local_cf2->id , Value => 'Baz' ); $ticket->AddCustomFieldValue( Field => $global_cf3->id , Value => 'Baz' ); # now if we ask for cf values on RecordCustomFields4 we should not get any -$cfvs = $ticket->CustomFieldValues( 'RecordCustomFields4' ); +warning_like { + $cfvs = $ticket->CustomFieldValues( 'RecordCustomFields4' ); +} qr{Couldn't load custom field}; is( $cfvs->Count, 0, "No custom field values for non-Queue cf" ); -is( $ticket->FirstCustomFieldValue( 'RecordCustomFields4' ), undef, "No first custom field value for non-Queue cf" ); +warning_like { + is( $ticket->FirstCustomFieldValue( 'RecordCustomFields4' ), undef, "No first custom field value for non-Queue cf" ); +} qr{Couldn't load custom field}; { my $cfname = $global_cf3->Name; |