Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Added custom folder override mechanism for unit test files.
Browse files Browse the repository at this point in the history
  • Loading branch information
UdoBretz authored and dvuckovic committed May 15, 2018
1 parent 01edacd commit 262ea6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Custom/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
If you need to modify already existing framework Perl module files or tt template files
for customizations, you can do this in the $OTRS_HOME/Custom/ directory.
or unit test files for customizations, you can do this in the $OTRS_HOME/Custom/ directory.

Example:

Expand All @@ -10,5 +10,7 @@ Example:
This method also works for tt files. Just place them in Kernel/Output/HTML/$ThemeName,
and they will be used if the theme is selected.

It also works for unit test files. Just place them in Custom/scripts/test.

If you use Apache + mod_perl or PerlEx, any Perl module files placed in this directory
will only be loaded by your web server after you restarted it.
6 changes: 6 additions & 0 deletions Kernel/System/UnitTest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ sub Run {
next FILE;
}

# Check if a file with the same path and name exists in the Custom folder.
my $CustomFile = $File =~ s{ \A $Home }{$Home/Custom}xmsr;
if ( -e $CustomFile ) {
$File = $CustomFile;
}

$Self->_HandleFile(
PostTestScripts => $Param{PostTestScripts},
File => $File,
Expand Down

0 comments on commit 262ea6b

Please sign in to comment.