"Fossies" - the Fresh Open Source Software Archive

Member "eprints3.4-3.4.4/tests/61_subjects.pl" (7 Aug 2022, 1583 Bytes) of package /linux/www/eprints3.4-3.4.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "61_subjects.pl": 3.4-3.4.3_vs_3.4-3.4.4.

    1 #!/usr/bin/perl
    2 
    3 use Test::More tests => 3;
    4 
    5 use strict;
    6 use warnings;
    7 
    8 BEGIN { use_ok( "EPrints" ); }
    9 BEGIN { use_ok( "EPrints::Test" ); }
   10 
   11 my $repoid = EPrints::Test::get_test_id();
   12 my $ep = EPrints->new();
   13 my $repo = $ep->repository( $repoid );
   14 
   15 my $searchexp = EPrints::Search->new(
   16     session => $repo,
   17     dataset => $repo->dataset( "subject" ),
   18     allow_blank => 1
   19 );
   20 
   21 my @subjects = $searchexp->perform_search->get_records();
   22 
   23 BAIL_OUT("No subjects loaded") if !@subjects;
   24 
   25 my $childless;
   26 for(@subjects)
   27 {
   28     $childless = $_, last if !($_->get_children);
   29 }
   30 
   31 $repo->cache_subjects;
   32 
   33 my $cached = EPrints::DataObj::Subject->new( $repo, $childless->get_id );
   34 
   35 #3451
   36 ok(!$cached->get_children, "can call get_children on childless subject");
   37 
   38 
   39 =head1 COPYRIGHT
   40 
   41 =for COPYRIGHT BEGIN
   42 
   43 Copyright 2022 University of Southampton.
   44 EPrints 3.4 is supplied by EPrints Services.
   45 
   46 http://www.eprints.org/eprints-3.4/
   47 
   48 =for COPYRIGHT END
   49 
   50 =for LICENSE BEGIN
   51 
   52 This file is part of EPrints 3.4 L<http://www.eprints.org/>.
   53 
   54 EPrints 3.4 and this file are released under the terms of the
   55 GNU Lesser General Public License version 3 as published by
   56 the Free Software Foundation unless otherwise stated.
   57 
   58 EPrints 3.4 is distributed in the hope that it will be useful,
   59 but WITHOUT ANY WARRANTY; without even the implied warranty of
   60 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   61 See the GNU Lesser General Public License for more details.
   62 
   63 You should have received a copy of the GNU Lesser General Public
   64 License along with EPrints 3.4.
   65 If not, see L<http://www.gnu.org/licenses/>.
   66 
   67 =for LICENSE END
   68