| 
      
            Lines 17-23
          
      
      
        Link Here
      
     | 
  
        
          | 17 | 
           | 
          17 | 
           | 
        
        
          | 18 | 
          use Modern::Perl;  | 
          18 | 
          use Modern::Perl;  | 
        
        
          | 19 | 
           | 
          19 | 
           | 
        
          
            
              | 20 | 
              use Test::More tests => 20;  | 
              20 | 
              use Test::More tests => 21;  | 
            
        
          | 21 | 
          use Test::Warn;  | 
          21 | 
          use Test::Warn;  | 
        
        
          | 22 | 
           | 
          22 | 
           | 
        
        
          | 23 | 
          use C4::Biblio qw( AddBiblio ModBiblio ModBiblioMarc );  | 
          23 | 
          use C4::Biblio qw( AddBiblio ModBiblio ModBiblioMarc );  | 
        
  
    | 
      
            Lines 884-889
          subtest 'get_marc_authors() tests' => sub {
      
      
        Link Here
      
     | 
  
        
          | 884 | 
              $schema->storage->txn_rollback;  | 
          884 | 
              $schema->storage->txn_rollback;  | 
        
        
          | 885 | 
          };  | 
          885 | 
          };  | 
        
        
          | 886 | 
           | 
          886 | 
           | 
        
            
               | 
               | 
              887 | 
              subtest 'item_groups() tests' => sub { | 
            
            
              | 888 | 
               | 
            
            
              | 889 | 
                  plan tests => 6;  | 
            
            
              | 890 | 
               | 
            
            
              | 891 | 
                  $schema->storage->txn_begin;  | 
            
            
              | 892 | 
               | 
            
            
              | 893 | 
                  my $biblio = $builder->build_sample_biblio();  | 
            
            
              | 894 | 
               | 
            
            
              | 895 | 
                  my @item_groups = $biblio->item_groups->as_list;  | 
            
            
              | 896 | 
                  is( scalar(@item_groups), 0, 'Got zero item groups');  | 
            
            
              | 897 | 
               | 
            
            
              | 898 | 
                  my $item_group_1 = Koha::Biblio::ItemGroup->new( { biblio_id => $biblio->id } )->store(); | 
            
            
              | 899 | 
               | 
            
            
              | 900 | 
                  @item_groups = $biblio->item_groups->as_list;  | 
            
            
              | 901 | 
                  is( scalar(@item_groups), 1, 'Got one item group');  | 
            
            
              | 902 | 
                  is( $item_groups[0]->id, $item_group_1->id, 'Got correct item group');  | 
            
            
              | 903 | 
               | 
            
            
              | 904 | 
                  my $item_group_2 = Koha::Biblio::ItemGroup->new( { biblio_id => $biblio->id } )->store(); | 
            
            
              | 905 | 
               | 
            
            
              | 906 | 
                  @item_groups = $biblio->item_groups->as_list;  | 
            
            
              | 907 | 
                  is( scalar(@item_groups), 2, 'Got two item groups');  | 
            
            
              | 908 | 
                  is( $item_groups[0]->id, $item_group_1->id, 'Got correct item group 1');  | 
            
            
              | 909 | 
                  is( $item_groups[1]->id, $item_group_2->id, 'Got correct item group 2');  | 
            
            
              | 910 | 
               | 
            
            
              | 911 | 
                  $schema->storage->txn_rollback;  | 
            
            
              | 912 | 
              };  | 
            
            
              | 913 | 
               | 
            
        
          | 887 | 
          sub component_record1 { | 
          914 | 
          sub component_record1 { | 
        
        
          | 888 | 
              my $marc = MARC::Record->new;  | 
          915 | 
              my $marc = MARC::Record->new;  | 
        
        
          | 889 | 
              $marc->append_fields(  | 
          916 | 
              $marc->append_fields(  |