start fixing test for multi cat phenotype upload.
[sgn.git] / t / unit_fixture / CXGN / BreedersToolbox / FindTrialsInCommon.t
blob68de3fc64db35a6b697bfdb116237ecb0e7f1fc1
1 #This script should test all functions in CXGN::Trial, CXGN::Trial::TrialLayout, CXGN::Trial::TrialDesign, CXGN::Trial::TrialCreate
3 use strict;
4 use lib 't/lib';
6 use Test::More;
7 use SGN::Test::Fixture;
8 use CXGN::BreederSearch;
9 use Data::Dumper;
11 my $f = SGN::Test::Fixture->new();
13 my $bs = CXGN::BreederSearch->new( { dbh=> $f->dbh() });
15 my $criteria_list = [
16                'accessions',
17                'trials'
18              ];
19 my $dataref = {
20                'trials' => {
21                              'accessions' => '\'38878\',\'38879\',\'38880\''
22                            }
23              };
24 my $queryref = {
25                'trials' => {
26                              'accessions' => 1
27                            }
28              };
30 my $results = $bs->metadata_query($criteria_list, $dataref, $queryref);
31 #print STDERR Dumper $results;
32 is_deeply($results, {
33                'results' => [
34                               [
35                                 139,
36                                 'Kasese solgs trial'
37                               ],
38                               [
39                                 144,
40                                 'test_t'
41                               ],
42                               [
43                                 141,
44                                 'trial2 NaCRRI'
45                               ]
46                             ]
47              }, 'trials in common query');
49 done_testing();