Changeset 1803


Ignore:
Timestamp:
06/28/16 16:40:49 (8 years ago)
Author:
nanardon
Message:

Add test on search

Location:
trunk/LATMOS-Accounts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts.pm

    r1798 r1803  
    1212use LATMOS::Accounts::I18N; 
    1313 
    14 our $VERSION = '5.1.23'; 
     14our $VERSION = '5.1.24'; 
    1515 
    1616=head1 NAME 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm

    r1800 r1803  
    817817        my @results = $class->_search_uniq_filter($base, $attr, $operator, $val); 
    818818 
    819         $results->{$attr} = {}; 
     819        $results->{$attr} ||= {}; 
    820820        $results->{$attr}{$_} = 1 foreach (@results)  
    821821    } 
  • trunk/LATMOS-Accounts/live-test/10_sql.t

    r1795 r1803  
    1818    plan skip_all => 'No SQL base defined'; 
    1919} else { 
    20     plan tests => 65; # Number of test 
     20    plan tests => 66; # Number of test 
    2121} 
    2222 
     
    207207    ), 'Can search on single attribute'); 
    208208    ok(eq_set( 
    209         [ $base->search_objects('user', 'givenName=Firstnamea', 
    210             'givenName=Firstnameb') ], 
    211         [ 'searchuaa', 'searchuba', 'searchuab', 'searchubb' ] 
     209        [ $base->search_objects('user', 'givenName=Firstnamea', 'givenName=Firstnameb') ], 
     210        [ 'searchuaa', 'searchuab', 'searchuba', 'searchubb' ] 
    212211    ), 'Can search on single attribute with 2 values'); 
    213212    ok(eq_set( 
     
    219218        [ 'searchuaa' ] 
    220219    ), 'Can search on 2 attributes'); 
     220    ok(! $base->search_objects('user', 'givenName=Firstnamea', 'sn=NoName'), 'Can search on 2 attributes, one return nothing'); 
    221221    ok(eq_set( 
    222222        [ $base->search_objects('user', 'givenName=NULL', 'sn=Lastnamea') ], 
Note: See TracChangeset for help on using the changeset viewer.