Committer: nnikulochkina
iLJSUP-14164: Unit tests infrastructureU trunk/cgi-bin/LJ/Test.pm
Modified: trunk/cgi-bin/LJ/Test.pm =================================================================== --- trunk/cgi-bin/LJ/Test.pm 2012-11-20 12:50:42 UTC (rev 23336) +++ trunk/cgi-bin/LJ/Test.pm 2012-11-20 15:46:12 UTC (rev 23337) @@ -261,9 +261,15 @@ $opts{name} ||= $opts{application_key}; $opts{type} ||= 'E'; $opts{status} ||= 'A'; - $opts{primary} ||= [@{$LJ::USERAPPS_ACCESS_LISTS}[0..2]]; - $opts{secondary} ||= [@{$LJ::USERAPPS_ACCESS_LISTS}[3..5]]; + unless ($opts{primary} || $opts{secondary} ) { + $opts{primary} = [@{$LJ::USERAPPS_ACCESS_LISTS}]; + $opts{secondary} = []; + } else { + $opts{primary} ||= []; + $opts{secondary} ||= []; + } + my $res = LJ::UserApps->add_application(%opts); if($res->{errors} && @{$res->{errors}}){ @@ -276,8 +282,6 @@ $app->set_primary($opts{primary}) if $opts{primary}; $app->set_secondary($opts{secondary}) if $opts{secondary}; - $app->{non} = $opts{non} || [@{$LJ::USERAPPS_ACCESS_LISTS}[6..$#$LJ::USERAPPS_ACCESS_LISTS]]; - return $app; }