Main Koha release repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.6 KiB

# some simple tests of the elements of C4::External::BakerTaylor that do not require a valid username and password
use strict;
use warnings;
use Test::More tests => 9;
# for testing, to avoid using C4::Context
my $username="testing_username";
my $password="testing_password";
# taken from C4::External::BakerTaylor::initialize
my $image_url = "$username&Password=$password&Options=Y&Return=T&Type=S&Value=";
# test without initializing
is( C4::External::BakerTaylor::image_url(), undef, "testing image url pre initilization");
is( C4::External::BakerTaylor::link_url(), undef, "testing link url pre initilization");
is( C4::External::BakerTaylor::content_cafe_url(""), undef, "testing content cafe url pre initilization");
is( C4::External::BakerTaylor::http_jacket_link(""), undef, "testing http jacket link pre initilization");
is( C4::External::BakerTaylor::availability(""), undef, "testing availability pre initilization");
# intitialize
C4::External::BakerTaylor::initialize($username, $password, "link_url");
# testing basic results
is( C4::External::BakerTaylor::image_url("aa"), $image_url."aa", "testing image url construction");
is( C4::External::BakerTaylor::link_url("bb"), "link_urlbb", "testing link url construction");
is( C4::External::BakerTaylor::content_cafe_url("cc"), "$username&Password=$password&Options=Y&ItemKey=cc", "testing content cafe url construction");