Bug 16805: Add test to getalert (no param passed)
TEST PLAN --------- 1) apply patch 2) prove t/db_dependent/Letters.t -- fails 3) run koha qa test tools Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> (cherry picked from commit5821ff3867) Signed-off-by: Frédéric Demians <f.demians@tamil.fr> (cherry picked from commita7dd3dcc3f) Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
parent
14fa3aa126
commit
441dee5b05
|
|
@ -18,7 +18,7 @@
|
|||
# along with Koha; if not, see <http://www.gnu.org/licenses>.
|
||||
|
||||
use Modern::Perl;
|
||||
use Test::More tests => 70;
|
||||
use Test::More tests => 71;
|
||||
use Test::MockModule;
|
||||
use Test::Warn;
|
||||
|
||||
|
|
@ -200,14 +200,16 @@ my $externalid = 'my external id';
|
|||
my $alert_id = C4::Letters::addalert($borrowernumber, $type, $externalid);
|
||||
isnt( $alert_id, undef, 'addalert does not return undef' );
|
||||
|
||||
my $alerts = C4::Letters::getalert($borrowernumber);
|
||||
|
||||
# getalert
|
||||
my $alerts = C4::Letters::getalert();
|
||||
is( @$alerts, 1, 'addalert should not fail without parameter' );
|
||||
$alerts = C4::Letters::getalert($borrowernumber);
|
||||
is( @$alerts, 1, 'addalert adds an alert' );
|
||||
is( $alerts->[0]->{alertid}, $alert_id, 'addalert returns the alert id correctly' );
|
||||
is( $alerts->[0]->{type}, $type, 'addalert stores the type correctly' );
|
||||
is( $alerts->[0]->{externalid}, $externalid, 'addalert stores the externalid correctly' );
|
||||
|
||||
|
||||
# getalert
|
||||
$alerts = C4::Letters::getalert($borrowernumber, $type);
|
||||
is( @$alerts, 1, 'getalert returns the correct number of alerts' );
|
||||
$alerts = C4::Letters::getalert($borrowernumber, $type, $externalid);
|
||||
|
|
|
|||
Loading…
Reference in New Issue