File tree Expand file tree Collapse file tree
scripts/test/DynamicField/ObjectType Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -207,18 +207,23 @@ for my $Test (@Tests) {
207207
208208 # implicitly call Kernel::System::Web::Request->new();
209209 my %ObjectData ;
210+ my $HasThrown ;
210211 try {
211212 %ObjectData = $ObjectHandlerObject -> ObjectDataGet( %{ $Test -> {Config } } );
212213 }
213214 catch {
214-
215- if ( !$Test -> {Throws } ) {
215+ $HasThrown = 1;
216216
217- ok(0," $Test ->{Name} - not expected to throw" );
217+ if ( $Test -> {Throws } ) {
218+ pass(" $Test ->{Name} should throw" );
219+ }
220+ else {
221+ fail(" $Test ->{Name} should not throw" );
218222 }
219- next TEST;
220223 };
221224
225+ next TEST if $HasThrown ;
226+
222227 if ( !$Test -> {Success } ) {
223228 is(
224229 \%ObjectData ,
Original file line number Diff line number Diff line change @@ -163,18 +163,23 @@ for my $Test (@Tests) {
163163
164164 # implicitly call Kernel::System::Web::Request->new();
165165 my %ObjectData ;
166+ my $HasThrown ;
166167 try {
167168 %ObjectData = $ObjectHandlerObject -> ObjectDataGet( %{ $Test -> {Config } } );
168169 }
169170 catch {
170-
171- if ( !$Test -> {Throws } ) {
172-
173- ok( 0, " $Test ->{Name} should not throw" );
171+ $HasThrown = 1;
172+
173+ if ( $Test -> {Throws } ) {
174+ pass(" $Test ->{Name} should throw" );
175+ }
176+ else {
177+ fail(" $Test ->{Name} should not throw" );
174178 }
175- next TEST;
176179 };
177180
181+ next TEST if $HasThrown ;
182+
178183 if ( !$Test -> {Success } ) {
179184 is(
180185 \%ObjectData ,
You can’t perform that action at this time.
0 commit comments