Bug 17960: Add a test to highlight the issue
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Sat, 21 Jan 2017 09:49:40 +0000 (10:49 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 6 Feb 2017 17:42:12 +0000 (17:42 +0000)
With only this patch applied, proving t/db_dependent/Koha/News.t
will return
  "Attempt to bless into a reference at /home/vagrant/kohaclone/Koha/Object.pm line 78."

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/db_dependent/Koha/News.t

index 8061bde..09095b4 100644 (file)
@@ -19,7 +19,7 @@
 
 use Modern::Perl;
 
-use Test::More tests => 4;
+use Test::More tests => 5;
 
 use Koha::NewsItem;
 use Koha::News;
@@ -47,6 +47,7 @@ is( Koha::News->search->count, $nb_of_news + 2, 'The 2 news should have been add
 
 my $retrieved_news_item_1 = Koha::News->find( $new_news_item_1->idnew );
 is( $retrieved_news_item_1->title, $new_news_item_1->title, 'Find a news_item by id should return the correct news_item' );
+is( $retrieved_news_item_1->new, $new_news_item_1->new, 'This test is failing because ->new is not a valid accessor');
 
 $retrieved_news_item_1->delete;
 is( Koha::News->search->count, $nb_of_news + 1, 'Delete should have deleted the news_item' );