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

[livejournal] r23332: LJSUP-14164: Unit tests infrastructure

Committer: nnikulochkina
LJSUP-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 09:10:13 UTC (rev 23331)
+++ trunk/cgi-bin/LJ/Test.pm	2012-11-20 10:21:13 UTC (rev 23332)
@@ -303,7 +303,10 @@
     my $class = shift;
     my %opts = @_;
     $opts{access} ||= [];
-    my $app = $opts{app} or die "Application is not specified";
+    my $app = $opts{app} ? 
+        $opts{app} : 
+        LJ::UserApps::Application->new( id => $opts{application_id} );
+    die "Application is not specified" unless $app;
     $app->authorize( userid => $opts{userid}, access => $opts{access} );
     my $token =  LJ::OAuth::AccessToken->generate(
                                                   consumer_key => $opts{consumer_key},

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