Skip to content

Commit

Permalink
Issue #7: fixed test script headers
Browse files Browse the repository at this point in the history
RegisterDriver is needed in the test framework
  • Loading branch information
bschmalhofer committed Mar 17, 2022
1 parent a138730 commit 4b9b4ed
Show file tree
Hide file tree
Showing 43 changed files with 439 additions and 159 deletions.
13 changes: 11 additions & 2 deletions scripts/test/Console/Command/Admin/FAQ/Import.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,20 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;
use utf8;

use vars (qw($Self));
# core modules

# CPAN modules

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

our $Self;

# get needed objects
$Kernel::OM->ObjectParamAdd(
Expand Down Expand Up @@ -51,4 +60,4 @@ $Self->Is(

# cleanup is done by restore database

1;
$Self->DoneTesting();
12 changes: 10 additions & 2 deletions scripts/test/Console/Command/Maint/FAQ/ContentTypeSet.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;
use utf8;

use vars (qw($Self));
# core modules

# CPAN modules

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

our $Self;

my $CommandObject = $Kernel::OM->Get('Kernel::System::Console::Command::Maint::FAQ::ContentTypeSet');

Expand All @@ -36,4 +44,4 @@ $Self->Is(
"Kernel::System::Console::Command::Maint::FAQ::ContentTypeSet exit code",
);

1;
$Self->DoneTesting();
14 changes: 10 additions & 4 deletions scripts/test/DynamicField/ObjectType/FAQ/ObjectDataGet.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;
use utf8;

use vars (qw($Self));
# core modules

# CPAN modules

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

our $Self;

# Get helper object
$Kernel::OM->ObjectParamAdd(
Expand Down Expand Up @@ -156,6 +164,4 @@ continue {
);
}

# cleanup is done by RestoreDatabase

1;
$Self->DoneTesting();
14 changes: 10 additions & 4 deletions scripts/test/FAQ.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;

use vars qw($Self);
# core modules

# CPAN modules

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

our $Self;

# get needed objects
$Kernel::OM->ObjectParamAdd(
Expand Down Expand Up @@ -1143,6 +1151,4 @@ $Self->Is(
"FAQCount() with multiple Categories success"
);

# cleanup is done by restore database

1;
$Self->DoneTesting();
13 changes: 11 additions & 2 deletions scripts/test/FAQ/Category/AgentCategorySearch.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;

use vars qw($Self);
# core modules

# CPAN modules

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

our $Self;

$Kernel::OM->ObjectParamAdd(
'Kernel::System::UnitTest::Helper' => {
Expand Down Expand Up @@ -300,4 +308,5 @@ for my $Test (@Tests) {
}

}
1;

$Self->DoneTesting();
12 changes: 10 additions & 2 deletions scripts/test/FAQ/Category/CategoryAdd.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;
use utf8;

use vars qw($Self);
# core modules

# CPAN modules

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

our $Self;

# get needed objects
$Kernel::OM->ObjectParamAdd(
Expand Down Expand Up @@ -187,4 +195,4 @@ for my $ParentCount ( 1 .. 10 ) {
$AddedCategoryIDs{$CategoryID} = 1;
}

1;
$Self->DoneTesting();
14 changes: 10 additions & 4 deletions scripts/test/FAQ/Category/CheckCategoryUserPermission.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;

use vars qw($Self);
# core modules

# CPAN modules

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

our $Self;

$Kernel::OM->ObjectParamAdd(
'Kernel::System::UnitTest::Helper' => {
Expand Down Expand Up @@ -204,6 +212,4 @@ continue {
);
}

# cleanup is done by restore database

1;
$Self->DoneTesting();
14 changes: 10 additions & 4 deletions scripts/test/FAQ/RelatedArticle.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;

use vars qw($Self);
# core modules

# CPAN modules

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

our $Self;

$Kernel::OM->ObjectParamAdd(
'Kernel::System::UnitTest::Helper' => {
Expand Down Expand Up @@ -855,6 +863,4 @@ continue {
$TestCount++;
}

# cleanup is done by restore database

1;
$Self->DoneTesting();
12 changes: 10 additions & 2 deletions scripts/test/FAQ/UpgradeLowerThan5092.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;

# core modules
use List::Util qw();
use vars qw($Self);

# CPAN modules

# OTOBO modules
use Kernel::System::UnitTest::RegisterDriver; # Set up $Self and $Kernel::OM
use var::packagesetup::FAQ;

our $Self;

my $Helper = $Kernel::OM->Get('Kernel::System::UnitTest::Helper');

my $SysConfigObject = $Kernel::OM->Get('Kernel::System::SysConfig');
Expand Down Expand Up @@ -300,4 +308,4 @@ $Self->True(
'Restored default configuration'
);

1;
$Self->DoneTesting();
14 changes: 10 additions & 4 deletions scripts/test/FAQSearch.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;

use vars qw($Self);
# core modules

# CPAN modules

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

our $Self;

# get helper object
$Kernel::OM->ObjectParamAdd(
Expand Down Expand Up @@ -1182,6 +1190,4 @@ $Self->True(
}
}

# cleanup is done by restore database

1;
$Self->DoneTesting();
14 changes: 10 additions & 4 deletions scripts/test/FAQSearch/InConditionGet.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;
use utf8;

use vars (qw($Self));
# core modules

# CPAN modules

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

our $Self;

# get helper object
$Kernel::OM->ObjectParamAdd(
Expand Down Expand Up @@ -82,6 +90,4 @@ for my $Test (@Tests) {
);
}

# cleanup is done by RestoreDatabase.

1;
$Self->DoneTesting();
14 changes: 11 additions & 3 deletions scripts/test/GenericInterface/FAQConnector.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,28 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
use strict;
use warnings;
use utf8;
use vars (qw($Self));

# core modules
use Socket;
use YAML;
use MIME::Base64;

# CPAN modules
use YAML;

# OTOBO modules
use Kernel::System::UnitTest::RegisterDriver; # Set up $Self and $Kernel::OM
use Kernel::GenericInterface::Debugger;
use Kernel::GenericInterface::Operation::FAQ::LanguageList;
use Kernel::GenericInterface::Operation::FAQ::PublicCategoryList;
use Kernel::GenericInterface::Operation::FAQ::PublicFAQSearch;
use Kernel::GenericInterface::Operation::FAQ::PublicFAQGet;

our $Self;

# get helper object
my $HelperObject = $Kernel::OM->Get('Kernel::System::UnitTest::Helper');

Expand Down Expand Up @@ -917,4 +925,4 @@ $Self->True(
"CategoryDelete() - Category: $CategoryIDOne",
);

1;
$Self->DoneTesting();
14 changes: 10 additions & 4 deletions scripts/test/Selenium/Agent/AgentFAQAdd.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,23 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use v5.24;
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

use vars (qw($Self));
# CPAN modules

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

our $Self;

# get selenium object
my $Selenium = $Kernel::OM->Get('Kernel::System::UnitTest::Selenium');
my $Selenium = Kernel::System::UnitTest::Selenium->new( LogExecuteCommandActive => 1 );

$Selenium->RunTest(
sub {
Expand Down
Loading

0 comments on commit 4b9b4ed

Please sign in to comment.