Skip to content

Commit

Permalink
Issue #616: adapt the FixedTimeSet() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Nov 5, 2020
1 parent 3cd7b01 commit c81b832
Show file tree
Hide file tree
Showing 90 changed files with 107 additions and 107 deletions.
2 changes: 1 addition & 1 deletion scripts/test/ACL/DB/ACL.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $Kernel::OM->ObjectParamAdd(
my $Helper = $Kernel::OM->Get('Kernel::System::UnitTest::Helper');

# set fixed time
$Helper->FixedTimeSet();
FixedTimeSet();

# define needed variables
my $RandomID = $Helper->GetRandomID();
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/AuthSession.t
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ for my $ModuleFile (@BackendModuleFiles) {
);

# Added some checks for the GetActiveSessions function
$Helper->FixedTimeSet();
FixedTimeSet();

$ConfigObject->Set(
Key => 'SessionMaxIdleTime',
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/Cache.t
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ for my $ModuleFile (@BackendModuleFiles) {

# set fixed time
if ( $FixedTimeCompatibleBackends{$Module} ) {
$Helper->FixedTimeSet();
FixedTimeSet();
}

my $CacheSet = $CacheObject->Set(
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/CommunicationLog.t
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ my @Test = (

for my $Test (@Test) {

$Helper->FixedTimeSet();
FixedTimeSet();

#
# CommunicationLog object create
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/CommunicationLog/DB.t
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ my @Test = (

for my $Test (@Test) {

$Helper->FixedTimeSet();
FixedTimeSet();

# Create an object, representing a new communication:
my $CommunicationLogObject = $Kernel::OM->Create(
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/Console/Command/Admin/Article/StorageSwitch.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $Kernel::OM->Get('Kernel::Config')->Set(
);

# create isolated time environment during test
$HelperObject->FixedTimeSet(
FixedTimeSet(
$Kernel::OM->Create(
'Kernel::System::DateTime',
ObjectParams => {
Expand Down
6 changes: 3 additions & 3 deletions scripts/test/Console/Command/Maint/FormDraft/Delete.t
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ $Self->True(
"Ticket is created - $TicketID"
);

$HelperObject->FixedTimeSet(
FixedTimeSet(
$Kernel::OM->Create(
'Kernel::System::DateTime',
ObjectParams => {
Expand Down Expand Up @@ -113,7 +113,7 @@ for ( 1 .. 3 ) {

# set fix time in order so further created drafts will be expired
# to test command with expired option and without it as well
$HelperObject->FixedTimeSet(
FixedTimeSet(
$Kernel::OM->Create(
'Kernel::System::DateTime',
ObjectParams => {
Expand All @@ -123,7 +123,7 @@ for ( 1 .. 3 ) {
);
}

$HelperObject->FixedTimeSet(
FixedTimeSet(
$Kernel::OM->Create(
'Kernel::System::DateTime',
ObjectParams => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/Console/Command/Maint/GenericAgent/Run.t
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ my %TicketConfig = (
);

# freeze time
$Helper->FixedTimeSet();
FixedTimeSet();

my $TicketID1 = $TicketObject->TicketCreate(%TicketConfig);
$Self->IsNot(
Expand Down
4 changes: 2 additions & 2 deletions scripts/test/Console/Command/Maint/Log/CommunicationLog.t
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ for my $TestCommunication (@Communications) {
String => $TestCommunication->{Date}
}
);
$HelperObject->FixedTimeSet($TestDateTimeObject);
FixedTimeSet($TestDateTimeObject);
}

my $CommunicationLogObject = $Kernel::OM->Create(
Expand Down Expand Up @@ -240,7 +240,7 @@ for my $CommunicationToTestPurge (@CommunicationsToTestPurge) {
my $TestDateTimeObject = $Kernel::OM->Create('Kernel::System::DateTime');
$TestDateTimeObject->Subtract( Hours => $CommunicationToTestPurge->{Date}->{Hours} );

$HelperObject->FixedTimeSet($TestDateTimeObject);
FixedTimeSet($TestDateTimeObject);

my $CommunicationLogObject = $Kernel::OM->Create(
'Kernel::System::CommunicationLog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ my $Helper = $Kernel::OM->Get('Kernel::System::UnitTest::Helper');

# Set fixed time to create user in pst.
# Then when it is set to invalid, it have been invalid for more than a month.
$Helper->FixedTimeSet(
FixedTimeSet(
$Kernel::OM->Create(
'Kernel::System::DateTime',
ObjectParams => {
Expand Down Expand Up @@ -128,7 +128,7 @@ $Self->True(

# Set current time in order to check InvalidUserCleanup console command.
# Created test user will be invalid for more than a month.
$Helper->FixedTimeSet();
FixedTimeSet();

my ( $UserName2, $UserID2 ) = $Helper->TestUserCreate();
my $TicketID2 = $TicketObject->TicketCreate(
Expand Down
4 changes: 2 additions & 2 deletions scripts/test/Console/Command/Maint/Ticket/PendingCheck.t
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ my $SystemTime = $Kernel::OM->Create(
)->ToEpoch();

# set the fixed time
$Helper->FixedTimeSet($SystemTime);
FixedTimeSet($SystemTime);

my $ExitCode = $CommandObject->Execute();

Expand Down Expand Up @@ -103,7 +103,7 @@ $SystemTime = $Kernel::OM->Create(
)->ToEpoch();

# set the fixed time
$Helper->FixedTimeSet($SystemTime);
FixedTimeSet($SystemTime);

$ExitCode = $CommandObject->Execute();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ for my $Module (qw(DB FS)) {
);

# set fixed time
$Helper->FixedTimeSet();
FixedTimeSet();

# wait 24h+1s to expire upload cache
$Helper->FixedTimeAddSeconds(86401);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ $ConfigObject->Set(
);

# freeze time
$Helper->FixedTimeSet();
FixedTimeSet();

my $CurSysDTObject = $Kernel::OM->Create('Kernel::System::DateTime');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ my $RunTasks = sub {
$RunTasks->();

# freeze time
$Helper->FixedTimeSet();
FixedTimeSet();

my $CurSysDTObject = $Kernel::OM->Create('Kernel::System::DateTime');
my $SecsDiff = $CurSysDTObject->Get()->{Second} - 60;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ $Self->True(
);

# freeze time
$Helper->FixedTimeSet();
FixedTimeSet();

my @Tests = (
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ my $Helper = $Kernel::OM->Get('Kernel::System::UnitTest::Helper');
my $RandomID = $Helper->GetRandomID();

# freeze time
$Helper->FixedTimeSet();
FixedTimeSet();

# web service config
my $WebserviceConfig = {
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/Daemon/SchedulerDB.t
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ for my $Task (@List) {
# TaskCleanup() tests

# freeze the current time
$Helper->FixedTimeSet();
FixedTimeSet();

my %TaskTemplate = (
Type => 'UnitTest',
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/Daemon/SchedulerDB/CronTaskToExecute.t
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ my @Tests = (
);

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

for my $Test (@Tests) {

Expand Down
2 changes: 1 addition & 1 deletion scripts/test/Daemon/SchedulerDBFutureTask.t
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $Kernel::OM->ObjectParamAdd(
my $Helper = $Kernel::OM->Get('Kernel::System::UnitTest::Helper');

# freeze time
$Helper->FixedTimeSet();
FixedTimeSet();

# get current time stamp
my $TimeStamp = $Kernel::OM->Create('Kernel::System::DateTime')->ToString();
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/Daemon/SchedulerDBRecurrentTask.t
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $CacheObject->CleanUp(
);

# freeze time
$Helper->FixedTimeSet();
FixedTimeSet();

my $SystemTimeObject = $Kernel::OM->Create('Kernel::System::DateTime');
my $SecsDiff = 60 - $SystemTimeObject->Get()->{Second};
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/DynamicField/EditFieldRender.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ my $DFBackendObject = $Kernel::OM->Get('Kernel::System::DynamicField::Backend');
my $ParamObject = $Kernel::OM->Get('Kernel::System::Web::Request');

# use a fixed year to compare the time selection results
$Helper->FixedTimeSet(
FixedTimeSet(
$Kernel::OM->Create(
'Kernel::System::DateTime',
ObjectParams => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/DynamicField/SearchFieldParameterBuild.t
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $Kernel::OM->ObjectParamAdd(
my $Helper = $Kernel::OM->Get('Kernel::System::UnitTest::Helper');

# Use a fixed year to compare the time selection results
$Helper->FixedTimeSet(
FixedTimeSet(
$Kernel::OM->Create(
'Kernel::System::DateTime',
ObjectParams => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/DynamicField/SearchFieldRender.t
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ my $DFBackendObject = $Kernel::OM->Get('Kernel::System::DynamicField::Backend');
# my $TimeObject = $Kernel::OM->Get('Kernel::System::Time');

# # use a fixed year to compare the time selection results
# $HelperObject->FixedTimeSet(
# FixedTimeSet(
# $TimeObject->TimeStamp2SystemTime( String => '2013-12-12 00:00:00' ),
# );

Expand Down
2 changes: 1 addition & 1 deletion scripts/test/Email/Bounce.t
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ my $SystemTime = $Kernel::OM->Create(
String => '2014-01-01 12:00:00',
},
);
$Helper->FixedTimeSet($SystemTime);
FixedTimeSet($SystemTime);

my $EmailObject = $Kernel::OM->Get('Kernel::System::Email');

Expand Down
4 changes: 2 additions & 2 deletions scripts/test/Event/Escalations.t
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $ConfigObject->Set(
);

# set fixed time
$HelperObject->FixedTimeSet(
FixedTimeSet(
$Kernel::OM->Create(
'Kernel::System::DateTime',
ObjectParams => {
Expand Down Expand Up @@ -535,7 +535,7 @@ $ConfigObject->Set(
);

# Set fixed time for testing.
$HelperObject->FixedTimeSet(
FixedTimeSet(
$Kernel::OM->Create(
'Kernel::System::DateTime',
ObjectParams => {
Expand Down
4 changes: 2 additions & 2 deletions scripts/test/GenericAgent.t
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ my $TestJobName = 'Job' . $Helper->GetRandomID();
my $OldPriorityID = 3;
my $NewPriorityID = 1;

$Helper->FixedTimeSet();
FixedTimeSet();

# Go 7 days to the past.
$Helper->FixedTimeAddSeconds( -60 * 60 * 24 * 7 );
Expand Down Expand Up @@ -718,7 +718,7 @@ $Self->Is(
"First job run - PriorityID is still '$OldPriorityID'",
);

$Helper->FixedTimeSet();
FixedTimeSet();

# Continue with ticket state changes (go 4 days to the past).
$Helper->FixedTimeAddSeconds( -60 * 60 * 24 * 4 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ my $SetDebugLogEntries = sub {
my $Success = $DateTimeObject->Add(
Days => 1,
);
$Helper->FixedTimeSet($DateTimeObject);
FixedTimeSet($DateTimeObject);

$Success = $DebugLogObject->LogAdd(
CommunicationID => $MainObject->MD5sum(
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/GenericInterface/ErrorHandling/RequestRetry.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ my $ErrorObject = $Kernel::OM->Get('Kernel::GenericInterface::ErrorHandling::Re
# set fixed time
my $CurrentDateTime = $Kernel::OM->Create('Kernel::System::DateTime');
my $CurrentDateTimeString = $CurrentDateTime->ToString();
$HelperObject->FixedTimeSet($CurrentDateTime);
FixedTimeSet($CurrentDateTime);

my $TimeDiff = sub {
my ( $Self, $CurrentDateTime, $TimeDiff ) = @_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $ConfigObject->Set(
);

# Set fixed time.
$Helper->FixedTimeSet();
FixedTimeSet();

my $TicketObject = $Kernel::OM->Get('Kernel::System::Ticket');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ $Helper->ConfigSettingChange(

my $SessionObject = $Kernel::OM->Get('Kernel::System::AuthSession');

$Helper->FixedTimeSet();
FixedTimeSet();

my $Epoch = $Kernel::OM->Create('Kernel::System::DateTime')->ToEpoch();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ $Self->Is(
'DebuggerObject instantiate correctly',
);

$Helper->FixedTimeSet();
FixedTimeSet();

my $ArticleObject = $Kernel::OM->Get('Kernel::System::Ticket::Article');

Expand Down
4 changes: 2 additions & 2 deletions scripts/test/GoogleAuthenticator.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $ConfigObject->Set(
);

# set fixed time to have predetermined verifiable results
$Helper->FixedTimeSet(0);
FixedTimeSet(0);

# configure auth backend to db
$ConfigObject->Set(
Expand Down Expand Up @@ -242,7 +242,7 @@ for my $Test (@Tests) {
# update time if necessary
if ( ( $Test->{FixedTimeSet} || 0 ) ne $CurrentConfig{Time} ) {
$CurrentConfig{Time} = $Test->{FixedTimeSet} || 0;
$Helper->FixedTimeSet( $CurrentConfig{Time} );
FixedTimeSet( $CurrentConfig{Time} );
}

# test agent auth
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/Language/Time.t
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ for my $Test (@Tests) {
},
);

$HelperObject->FixedTimeSet($DateTimeObject);
FixedTimeSet($DateTimeObject);

my $Result = $LanguageObject->Time(
%{ $Test->{Data} },
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/Layout/BuildDateSelection.t
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ for my $Test (@Tests) {
$BuildSelectionParams{ $Prefix . 'Minute' } = $DateTimeValues->{Minute};
}
else {
$HelperObject->FixedTimeSet( $DateTimeObject->ToEpoch() );
FixedTimeSet( $DateTimeObject->ToEpoch() );
}

my $LayoutObject = $Kernel::OM->Get('Kernel::Output::HTML::Layout');
Expand Down
4 changes: 2 additions & 2 deletions scripts/test/Layout/Template/Render.t
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ for my $Test (@Tests) {
},
);

$HelperObject->FixedTimeSet($DateTimeObject);
FixedTimeSet($DateTimeObject);
}

# make sure EnvRef is populated every time
Expand Down Expand Up @@ -566,7 +566,7 @@ for my $Test (@Tests) {
if ( $Test->{FixedTimeSet} ) {

# Reset time to the current timestamp.
$HelperObject->FixedTimeSet();
FixedTimeSet();
}
}

Expand Down
Loading

0 comments on commit c81b832

Please sign in to comment.