Bug 16636: [QA Follow-up] Move External_BakerTaylor.t to t
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 10 Jun 2016 08:31:34 +0000 (10:31 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 10 Jun 2016 18:00:22 +0000 (18:00 +0000)
When we mock the preferences completely now, we do not need
db access anymore.

Test plan:
Run the test without exporting KOHA_CONF.
The test passes with some warns about koha-conf.xml.
If you point KOHA_CONF to etc/koha-conf.xml, you have no warns.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/External_BakerTaylor.t [new file with mode: 0755]
t/db_dependent/External_BakerTaylor.t [deleted file]

diff --git a/t/External_BakerTaylor.t b/t/External_BakerTaylor.t
new file mode 100755 (executable)
index 0000000..cbaa56e
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+
+# some simple tests of the elements of C4::External::BakerTaylor that do not require a valid username and password
+
+use Modern::Perl;
+
+use Test::More tests => 9;
+use t::lib::Mocks;
+
+BEGIN {
+        use_ok('C4::External::BakerTaylor');
+}
+
+# test with mocked prefs
+my $username= "testing_username";
+my $password= "testing_password";
+my $link_url = "http://wrongexample.com?ContentCafe.aspx?UserID=$username";
+
+t::lib::Mocks::mock_preference( 'BakerTaylorUsername', $username );
+t::lib::Mocks::mock_preference( 'BakerTaylorPassword', $password );
+t::lib::Mocks::mock_preference( 'BakerTaylorBookstoreURL', $link_url );
+
+my $image_url = "http://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$username&Password=$password&Options=Y&Return=T&Type=S&Value=";
+my $content_cafe = "http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$username&Password=$password&Options=Y&ItemKey=";
+
+is( C4::External::BakerTaylor::image_url(), $image_url, "testing default image url");
+is( C4::External::BakerTaylor::image_url("aa"), $image_url."aa", "testing image url construction");
+is( C4::External::BakerTaylor::link_url(), $link_url, "testing default link url");
+is( C4::External::BakerTaylor::link_url("bb"), "${link_url}bb", "testing link url construction");
+is( C4::External::BakerTaylor::content_cafe_url(""), $content_cafe, "testing default content cafe url");
+is( C4::External::BakerTaylor::content_cafe_url("cc"), "${content_cafe}cc", "testing content cafe url construction");
+is( C4::External::BakerTaylor::http_jacket_link(""), undef, "testing empty http jacket link");
+is( C4::External::BakerTaylor::availability(""), undef, "testing empty availability");
diff --git a/t/db_dependent/External_BakerTaylor.t b/t/db_dependent/External_BakerTaylor.t
deleted file mode 100755 (executable)
index cbaa56e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/perl
-
-# some simple tests of the elements of C4::External::BakerTaylor that do not require a valid username and password
-
-use Modern::Perl;
-
-use Test::More tests => 9;
-use t::lib::Mocks;
-
-BEGIN {
-        use_ok('C4::External::BakerTaylor');
-}
-
-# test with mocked prefs
-my $username= "testing_username";
-my $password= "testing_password";
-my $link_url = "http://wrongexample.com?ContentCafe.aspx?UserID=$username";
-
-t::lib::Mocks::mock_preference( 'BakerTaylorUsername', $username );
-t::lib::Mocks::mock_preference( 'BakerTaylorPassword', $password );
-t::lib::Mocks::mock_preference( 'BakerTaylorBookstoreURL', $link_url );
-
-my $image_url = "http://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$username&Password=$password&Options=Y&Return=T&Type=S&Value=";
-my $content_cafe = "http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$username&Password=$password&Options=Y&ItemKey=";
-
-is( C4::External::BakerTaylor::image_url(), $image_url, "testing default image url");
-is( C4::External::BakerTaylor::image_url("aa"), $image_url."aa", "testing image url construction");
-is( C4::External::BakerTaylor::link_url(), $link_url, "testing default link url");
-is( C4::External::BakerTaylor::link_url("bb"), "${link_url}bb", "testing link url construction");
-is( C4::External::BakerTaylor::content_cafe_url(""), $content_cafe, "testing default content cafe url");
-is( C4::External::BakerTaylor::content_cafe_url("cc"), "${content_cafe}cc", "testing content cafe url construction");
-is( C4::External::BakerTaylor::http_jacket_link(""), undef, "testing empty http jacket link");
-is( C4::External::BakerTaylor::availability(""), undef, "testing empty availability");