Bug 13453: Koha.t daily quote tests assume sample data
authorMark Tompsett <mtompset@hotmail.com>
Fri, 12 Dec 2014 17:28:11 +0000 (12:28 -0500)
committerMason James <mtj@kohaaloha.com>
Fri, 23 Jan 2015 06:58:25 +0000 (19:58 +1300)
By adding quotes 3 and 25 from the sample data, this test can
pass without having the sample quote data loaded.

TEST PLAN
---------
1) Ensure there is no quote id=3 or that it is NOT
   Abraham Lincoln.
2) prove t/db_dependent/Koha.t
   -- this should fail the daily quote test.
3) apply patch
4) prove t/db_dependent/Koha.t
   -- this should *NOT* fail the daily quote test.
5) run koha qa test tools

Followed test plan 1)-4). Without patch, daily quote test failed. With patch, test passed OK.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Works as described, leaves actual data unchanged.
Signed-off-by: Mason James <mtj@kohaaloha.com>

t/db_dependent/Koha.t

index 0e90403..e48cd2a 100644 (file)
@@ -174,6 +174,13 @@ SKIP:
 
                 skip "C4::Koha can't \'GetDailyQuote\'!", 3 unless can_ok('C4::Koha','GetDailyQuote');
 
+# Fill the quote table with the default needed and a spare
+$dbh->do("DELETE FROM quotes WHERE id=3 OR id=25;");
+my $sql = "INSERT INTO quotes (id,source,text,timestamp) VALUES
+(25,'Richard Nixon','When the President does it, that means that it is not illegal.','0000-00-00 00:00:00'),
+(3,'Abraham Lincoln','Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.','0000-00-00 00:00:00');";
+$dbh->do($sql);
+
                 my $expected_quote = {
                     id          => 3,
                     source      => 'Abraham Lincoln',