Skip to content

Commit

Permalink
Issue #2749: tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Dec 6, 2023
1 parent f850bcb commit 3528496
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
12 changes: 10 additions & 2 deletions Kernel/System/DynamicField.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@

package Kernel::System::DynamicField;

use v5.24;
use strict;
use warnings;
use namespace::autoclean;
use utf8;

use parent qw(Kernel::System::EventHandler);

# core modules

# CPAN modules

# OTOBO modules
use Kernel::System::VariableCheck qw(:all);

our @ObjectDependencies = (
Expand All @@ -34,11 +42,11 @@ our @ObjectDependencies = (

=head1 NAME
Kernel::System::DynamicField
Kernel::System::DynamicField - general methods for dynamic fields
=head1 DESCRIPTION
DynamicFields backend
DynamicFields backend.
=head1 PUBLIC INTERFACE
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/DB/ConvenienceMethods.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ConvenienceMethods.t - test some select methods of Kernel::System::DB
=head1 SYNOPSIS
prove -I . -I Kernel/cpan-lib/ --verbose --merge scripts/test/DB/ConvenienceMethods.t
bin/otobo.Console.pl Dev::UnitTest::Run --verbose --merge scripts/test/DB/ConvenienceMethods.t
=head1 DESCRIPTION
Expand Down
28 changes: 13 additions & 15 deletions scripts/test/DynamicField.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.024;
use strict;
use warnings;
use utf8;

# Set up the test driver $Self when we are running as a standalone script.
use Kernel::System::UnitTest::RegisterDriver;
# core modules

# CPAN modules
use Test2::V0;

# OTOBO modules
use Kernel::System::UnitTest::RegisterDriver; # Set up the test driver $Self and $Kernel::OM

our $Self;

Expand Down Expand Up @@ -287,23 +293,18 @@ for my $Test (@Tests) {
);
}

# add config
# add dynamic field
my $DynamicFieldID = $DynamicFieldObject->DynamicFieldAdd(
Name => $FieldName,
%{ $Test->{Add} },
);
if ( !$Test->{SuccessAdd} ) {
$Self->False(
$DynamicFieldID,
"$Test->{Name} - DynamicFieldAdd()",
);
ok( !$DynamicFieldID, "$Test->{Name} - DynamicFieldAdd() expected to fail" );

next TEST;
}
else {
$Self->True(
$DynamicFieldID,
"$Test->{Name} - DynamicFieldAdd()",
);
ok( $DynamicFieldID, "$Test->{Name} - DynamicFieldAdd() was successful" );
}

# remember id to delete it later
Expand Down Expand Up @@ -759,7 +760,6 @@ for my $Test (@Tests) {

$OrderLookup{ $Test->{Name} . $RandomID } = $Test->{Add}->{FieldOrder};
}

}

# sanity checks
Expand Down Expand Up @@ -1707,6 +1707,4 @@ for my $DynamicFieldID (@AddedFieldIDs) {
);
}

# cleanup is done by RestoreDatabase

$Self->DoneTesting();
done_testing;

0 comments on commit 3528496

Please sign in to comment.