/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 105 - (hide 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 dpavlin 78 #!/usr/bin/perl
2    
3     use warnings;
4     use strict;
5    
6 dpavlin 105 use Test::More tests => 7;
7 dpavlin 78 use Test::WWW::Mechanize;
8 dpavlin 104 use XML::Simple;
9     use Data::Dump qw(dump);
10 dpavlin 78
11 dpavlin 104 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 dpavlin 78
14 dpavlin 104 my $xml = XMLin( $koha_conf );
15     diag 'Koha config = ',dump $xml->{config};
16 dpavlin 78
17 dpavlin 105 ok( $xml->{config}->{useldapserver}, 'useldapserver' );
18    
19 dpavlin 104 our $config;
20     require 't/config.pl';
21     diag 'test config = ',dump $config;
22    
23 dpavlin 78 my $mech = Test::WWW::Mechanize->new;
24    
25 dpavlin 105 $mech->get_ok( $url, "intranet $url" );
26 dpavlin 78
27     $mech->submit_form_ok({
28     fields => {
29 dpavlin 104 userid => $xml->{config}->{user},
30     password => $xml->{config}->{pass},
31 dpavlin 78 },
32 dpavlin 104 }, "login $xml->{config}->{user}");
33 dpavlin 78
34     $mech->submit_form_ok({
35     form_number => 2,
36     fields => {
37 dpavlin 105 member => $config->{bind_as},
38 dpavlin 78 },
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