This repository has been archived by the owner on Jan 27, 2021. It is now read-only.
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fixed issue with not correctly quoted search parameters.
- Loading branch information
1 parent
1347926
commit 3700f75
Showing
6 changed files
with
194 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # -- | ||
| # Copyright (C) 2001-2016 OTRS AG, http://otrs.com/ | ||
| # -- | ||
| # This software comes with ABSOLUTELY NO WARRANTY. For details, see | ||
| # the enclosed file COPYING for license information (AGPL). If you | ||
| # did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | ||
| # -- | ||
|
|
||
| ## no critic (Modules::RequireExplicitPackage) | ||
| use strict; | ||
| use warnings; | ||
| use utf8; | ||
|
|
||
| use vars (qw($Self)); | ||
|
|
||
| # get helper object | ||
| $Kernel::OM->ObjectParamAdd( | ||
| 'Kernel::System::UnitTest::Helper' => { | ||
| RestoreDatabase => 1, | ||
| }, | ||
| ); | ||
| my $Helper = $Kernel::OM->Get('Kernel::System::UnitTest::Helper'); | ||
|
|
||
| my @Tests = ( | ||
| { | ||
| Name => 'No array', | ||
| Params => { | ||
| TableColumn => 'test.table', | ||
| IDRef => 1, | ||
| }, | ||
| Result => undef, | ||
| }, | ||
| { | ||
| Name => 'Single Integer', | ||
| Params => { | ||
| TableColumn => 'test.table', | ||
| IDRef => [1], | ||
| }, | ||
| Result => ' ( test.table IN (1) ) ', | ||
| }, | ||
| { | ||
| Name => 'Sorted values', | ||
| Params => { | ||
| TableColumn => 'test.table', | ||
| IDRef => [ 2, 1, -1, 0 ], | ||
| }, | ||
| Result => ' ( test.table IN (-1, 0, 1, 2) ) ', | ||
| }, | ||
| { | ||
| Name => 'Invalid value', | ||
| Params => { | ||
| TableColumn => 'test.table', | ||
| IDRef => [1.1], | ||
| }, | ||
| Result => undef, | ||
| }, | ||
| { | ||
| Name => 'Mix of valid and invalid values', | ||
| Params => { | ||
| TableColumn => 'test.table', | ||
| IDRef => [ 1, 1.1 ], | ||
| }, | ||
| Result => undef, | ||
| }, | ||
| ); | ||
|
|
||
| # get FAQ object | ||
| my $FAQObject = $Kernel::OM->Get('Kernel::System::FAQ'); | ||
|
|
||
| for my $Test (@Tests) { | ||
| $Self->Is( | ||
| scalar $FAQObject->_InConditionGet( %{ $Test->{Params} } ), | ||
| $Test->{Result}, | ||
| "$Test->{Name} _InConditionGet()" | ||
| ); | ||
| } | ||
|
|
||
| # cleanup is done by RestoreDatabase. | ||
|
|
||
| 1; |