"Fossies" - the Fresh Open Source Software Archive

Member "eprints3.4-3.4.4/tests/02_session.pl" (7 Aug 2022, 2033 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 "02_session.pl": 3.4-3.4.3_vs_3.4-3.4.4.

    1 use strict;
    2 use Test::More tests => 15;
    3 
    4 BEGIN { use_ok( "EPrints" ); }
    5 BEGIN { use_ok( "EPrints::Test" ); }
    6 
    7 EPrints::Test::mem_increase();
    8 
    9 my $session = EPrints::Test::get_test_session( 0 );
   10 ok(defined $session, 'opened an EPrints::Session object (noisy, no_check_db)');
   11 
   12 # check it's the right type
   13 ok($session->isa('EPrints::Repository'),'it really was an EPrints::Repository');
   14 
   15 is($session->{noise},0,"Correct noise setting?");
   16 is($session->{offline},1,"Correct offline setting?");
   17 is($session->{query},undef,"There should be no query, we're offline");
   18 
   19 ok(defined $session->get_repository, "is there a repository config attached?");
   20 ok($session->get_repository->isa('EPrints::Repository'), "and it's really an repository");
   21 
   22 ok(defined $session->get_database, "is there a database attached?");
   23 ok($session->get_database->isa('EPrints::Database'), "and it's really an EPrints::Database?");
   24 
   25 ok(defined $session->{lang}, "session has a language set" );
   26 ok($session->{lang}->isa('EPrints::Language'), "and it's EPrints::Language" );
   27 is($session->{lang}->{id}, 'en', "and it's the default (english)" );
   28 
   29 $session->terminate;
   30 ok(!defined $session->{database}, "cleaned up session" );
   31 
   32 =head1 COPYRIGHT
   33 
   34 =for COPYRIGHT BEGIN
   35 
   36 Copyright 2022 University of Southampton.
   37 EPrints 3.4 is supplied by EPrints Services.
   38 
   39 http://www.eprints.org/eprints-3.4/
   40 
   41 =for COPYRIGHT END
   42 
   43 =for LICENSE BEGIN
   44 
   45 This file is part of EPrints 3.4 L<http://www.eprints.org/>.
   46 
   47 EPrints 3.4 and this file are released under the terms of the
   48 GNU Lesser General Public License version 3 as published by
   49 the Free Software Foundation unless otherwise stated.
   50 
   51 EPrints 3.4 is distributed in the hope that it will be useful,
   52 but WITHOUT ANY WARRANTY; without even the implied warranty of
   53 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   54 See the GNU Lesser General Public License for more details.
   55 
   56 You should have received a copy of the GNU Lesser General Public
   57 License along with EPrints 3.4.
   58 If not, see L<http://www.gnu.org/licenses/>.
   59 
   60 =for LICENSE END
   61