Bug 25008: Tests for ->options
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 30 Mar 2020 13:20:11 +0000 (10:20 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 14 Apr 2020 07:31:22 +0000 (08:31 +0100)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
t/RecordProcessor.t

index aab2b3c..9a0db02 100755 (executable)
@@ -151,7 +151,7 @@ subtest 'new() tests' => sub {
 
 subtest 'options() tests' => sub {
 
-    plan tests => 4;
+    plan tests => 6;
 
     # Create a processor with some options
     my $record_processor = Koha::RecordProcessor->new(
@@ -178,12 +178,15 @@ subtest 'options() tests' => sub {
     );
 
     # Update the chosen options
-    $record_processor->options(
+    my $ret = $record_processor->options(
         {
             dummy => 'something else'
         }
     );
 
+    is( ref($ret), 'Koha::RecordProcessor', 'The setter return the object for chaining calls' );
+    is_deeply( $record_processor->options, { dummy => 'something else' }, 'The getter works as expected' );
+
     # Re-fetch the filter
     $filter = $record_processor->filters->[0];