журнал журнал (shhh) wrote in changelog,
журнал журнал
shhh
changelog

[livejournal] r23337: iLJSUP-14164: Unit tests infrastructure

Committer: nnikulochkina
iLJSUP-14164: Unit tests infrastructure
U   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;
 }
 

Tags: livejournal, nikulochkina, nnikulochkina, pm
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments