File: fix-WWW%3A%3AMechanize_v2.20_in_tests.diff

package info (click to toggle)
request-tracker5 5.0.7%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 80,264 kB
  • sloc: javascript: 191,898; perl: 87,146; sh: 1,426; makefile: 487; python: 37; php: 15
file content (96 lines) | stat: -rw-r--r-- 4,302 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
From 254fc1eba35f0606f5e90e9510595aa8337505fa Mon Sep 17 00:00:00 2001
From: Andrew Ruthven <andrew@etc.gen.nz>
Date: Mon, 27 Oct 2025 13:05:12 +1300
Subject: Support WWW::Mechanize v2.20

The select method now requires the second element to be the occurence
of the form to select. As it now supports working on not just the first
form that matches. See:

    https://metacpan.org/dist/WWW-Mechanize/changes

Patch-Name: fix-WWW::Mechanize_v2.20_in_tests.diff
Bug-Vendor: https://rt.bestpractical.com/Ticket/Display.html?id=38076
Forwarded: https://github.com/bestpractical/rt/pull/409
---
 t/web/admin_groups.t | 12 ++++++------
 t/web/admin_user.t   | 10 +++++-----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/t/web/admin_groups.t b/t/web/admin_groups.t
index a4cc1c8d..c0a886ae 100644
--- a/t/web/admin_groups.t
+++ b/t/web/admin_groups.t
@@ -119,11 +119,11 @@ ok( $m->login(), 'logged in' );
 
     $m->get_ok( $url . '/Admin/Groups/index.html' );
     ok( $m->form_name( 'GroupsAdmin' ), 'found the filter admin groups form');
-    $m->select( GroupField => 'Name', GroupOp => 'LIKE' );
+    $m->select( GroupField => 'Name', 1, GroupOp => 'LIKE' );
     $m->field( GroupString => 'Group' );
-    $m->select( GroupField2 => 'CustomField: '.$cf_1->Name, GroupOp2 => 'LIKE' );
+    $m->select( GroupField2 => 'CustomField: '.$cf_1->Name, 1, GroupOp2 => 'LIKE' );
     $m->field( GroupString2 => 'one' );
-    $m->select( GroupField3 => 'CustomField: '.$cf_2->Name, GroupOp3 => 'LIKE' );
+    $m->select( GroupField3 => 'CustomField: '.$cf_2->Name, 1, GroupOp3 => 'LIKE' );
     $m->field( GroupString3 => 'two' );
     $m->click( 'Go' );
 
@@ -135,9 +135,9 @@ ok( $m->login(), 'logged in' );
 
     diag 'Test NULL value searches';
     ok( $m->form_name( 'GroupsAdmin' ), 'found the filter admin groups form');
-    $m->select( GroupField => 'Name', GroupOp => 'LIKE' );
+    $m->select( GroupField => 'Name', 1, GroupOp => 'LIKE' );
     $m->field( GroupString => 'Group' );
-    $m->select( GroupField2 => 'CustomField: '.$cf_2->Name, GroupOp2 => 'is' );
+    $m->select( GroupField2 => 'CustomField: '.$cf_2->Name, 1, GroupOp2 => 'is' );
     $m->field( GroupString2 => 'NULL' );
     $m->field( GroupString3 => '' );
     $m->click( 'Go' );
@@ -146,7 +146,7 @@ ok( $m->login(), 'logged in' );
 
     ok( $groups[0]->SetDescription('group1') );
     $m->form_name( 'GroupsAdmin' );
-    $m->select( GroupField2 => 'Description', GroupOp2 => 'is' );
+    $m->select( GroupField2 => 'Description', 1, GroupOp2 => 'is' );
     $m->field( GroupString2 => 'NULL' );
     $m->click( 'Go' );
     $m->text_lacks( $_->Name ) for $groups[0];
diff --git a/t/web/admin_user.t b/t/web/admin_user.t
index a75236bd..6abb6bde 100644
--- a/t/web/admin_user.t
+++ b/t/web/admin_user.t
@@ -118,11 +118,11 @@ $users[2]->AddCustomFieldValue( Field => $cf_3->id, Value => 'three' );
 
 $m->get_ok( $url . '/Admin/Users/index.html' );
 ok( $m->form_name( 'UsersAdmin' ), 'found the filter admin users form');
-$m->select( UserField => 'Name', UserOp => 'LIKE' );
+$m->select( UserField => 'Name', 1, UserOp => 'LIKE' );
 $m->field( UserString => 'user' );
-$m->select( UserField2 => 'CustomField: '.$cf_1->Name, UserOp2 => 'LIKE' );
+$m->select( UserField2 => 'CustomField: '.$cf_1->Name, 1, UserOp2 => 'LIKE' );
 $m->field( UserString2 => 'one' );
-$m->select( UserField3 => 'CustomField: '.$cf_2->Name, UserOp3 => 'LIKE' );
+$m->select( UserField3 => 'CustomField: '.$cf_2->Name, 1, UserOp3 => 'LIKE' );
 $m->field( UserString3 => 'two' );
 $m->click( 'Go' );
 
@@ -134,7 +134,7 @@ $m->content_lacks( $users[3]->Name );
 
 diag 'Test NULL value searches';
 $m->form_name( 'UsersAdmin' );
-$m->select( UserField2 => 'CustomField: '.$cf_2->Name, UserOp2 => 'is' );
+$m->select( UserField2 => 'CustomField: '.$cf_2->Name, 1, UserOp2 => 'is' );
 $m->field( UserString2 => 'NULL' );
 $m->field( UserString3 => '' );
 $m->click( 'Go' );
@@ -143,7 +143,7 @@ $m->text_contains( $_->Name ) for @users[0,3];
 
 ok( $users[0]->SetRealName('user1') );
 $m->form_name( 'UsersAdmin' );
-$m->select( UserField2 => 'Real Name', UserOp2 => 'is' );
+$m->select( UserField2 => 'Real Name', 1, UserOp2 => 'is' );
 $m->field( UserString2 => 'NULL' );
 $m->click( 'Go' );
 $m->text_lacks( $_->Name ) for $users[0];