View | Details | Raw Unified | Return to bug 7380
Collapse All | Expand All

(-)a/t/db_dependent/Members.t (-14 / +1 lines)
Lines 17-28 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 74;
20
use Test::More tests => 72;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Data::Dumper;
22
use Data::Dumper;
23
use C4::Context;
23
use C4::Context;
24
use C4::Members::Attributes qw( SetBorrowerAttributes );
25
use C4::Members::AttributeTypes;
26
24
27
BEGIN {
25
BEGIN {
28
        use_ok('C4::Members');
26
        use_ok('C4::Members');
Lines 185-200 $results = Search(\@searchstring); Link Here
185
ok (_find_member($results), "Search (arrayref) for independent branches, same branch")
183
ok (_find_member($results), "Search (arrayref) for independent branches, same branch")
186
  or diag("Card $CARDNUMBER not found in the resultset for independent branches: ".Dumper(C4::Context->preference($INDEPENDENT_BRANCHES_PREF), $results));
184
  or diag("Card $CARDNUMBER not found in the resultset for independent branches: ".Dumper(C4::Context->preference($INDEPENDENT_BRANCHES_PREF), $results));
187
185
188
C4::Context->set_preference('ExtendedPatronAttributes', 1);
189
my $attr_type = C4::Members::AttributeTypes->new("TEST", "Test Description");
190
$attr_type->staff_searchable(1);
191
$attr_type->store();
192
SetBorrowerAttributes($addmem, [ { code => 'TEST', value => 'XYZZYX' } ] );
193
$results = Search( "XYZZYX", undef, undef, undef, undef, undef, 1 );
194
is( @$results, 0, "Search without extended attributes returns no results" );
195
$results = Search( "XYZZYX", undef, undef, undef, undef, undef, 0 );
196
is( @$results, 1, "Search with extended attributes returns results" );
197
198
C4::Context->set_preference( 'CardnumberLength', '' );
186
C4::Context->set_preference( 'CardnumberLength', '' );
199
C4::Context->clear_syspref_cache();
187
C4::Context->clear_syspref_cache();
200
188
201
- 

Return to bug 7380