/[virtual-ldap]/t/koha/01-remove-test-user.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /t/koha/01-remove-test-user.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 105 - (show annotations)
Thu Jul 14 20:18:57 2011 UTC (12 years, 8 months ago) by dpavlin
File MIME type: application/x-troff
File size: 1095 byte(s)
use bind_as from config file
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 use Test::More tests => 7;
7 use Test::WWW::Mechanize;
8 use XML::Simple;
9 use Data::Dump qw(dump);
10
11 my $url = $ENV{INTRANET} || 'http://ffzg.koha-dev.rot13.org:8080';
12 my $koha_conf = $ENV{KOHA_CONF} || '/etc/koha/sites/ffzg/koha-conf.xml';
13
14 my $xml = XMLin( $koha_conf );
15 diag 'Koha config = ',dump $xml->{config};
16
17 ok( $xml->{config}->{useldapserver}, 'useldapserver' );
18
19 our $config;
20 require 't/config.pl';
21 diag 'test config = ',dump $config;
22
23 my $mech = Test::WWW::Mechanize->new;
24
25 $mech->get_ok( $url, "intranet $url" );
26
27 $mech->submit_form_ok({
28 fields => {
29 userid => $xml->{config}->{user},
30 password => $xml->{config}->{pass},
31 },
32 }, "login $xml->{config}->{user}");
33
34 $mech->submit_form_ok({
35 form_number => 2,
36 fields => {
37 member => $config->{bind_as},
38 },
39 }, 'find patron' );
40
41 #diag $mech->content;
42
43 $mech->follow_link_ok({ url_regex => qr/moremember/ }, 'details' );
44
45 my $html = $mech->content();
46
47 if ( $html =~ m{(/cgi-bin/koha/members/deletemem\.pl\?member=\d+)}s ) {
48 ok( $1, 'found deletemem' );
49 $mech->get_ok( $url . $1 );
50 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26