Bug 19655: Use ->build instead of build_object in 16.11.x
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 12 Dec 2017 13:28:40 +0000 (10:28 -0300)
committerChris Cormack <chrisc@catalyst.net.nz>
Thu, 14 Dec 2017 21:26:35 +0000 (10:26 +1300)
The build_object method of TestBuilder has been added by bug 18182,
which is not in 16.11.x

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

t/db_dependent/Template/Plugin/To.t

index 033891f..1b03218 100644 (file)
@@ -29,9 +29,9 @@ my $builder = t::lib::TestBuilder->new;
 
 subtest 'json' => sub {
     plan tests => 1;
-    my $patron = $builder->build_object(
+    my $patron = $builder->build(
         {
-            class => 'Koha::Patrons',
+            source => 'Borrower',
             value => {
                 borrowernotes => q|
 several
@@ -40,7 +40,7 @@ lines|,
         }
     );
     my $expected_escaped_notes = q|\\\\nseveral\\\\nlines|;
-    is( Koha::Template::Plugin::To->json( $patron->borrowernotes ), $expected_escaped_notes );
+    is( Koha::Template::Plugin::To->json( $patron->{borrowernotes} ), $expected_escaped_notes );
 };
 
 $schema->storage->txn_rollback;