[Jifty-commit] r610 - in jifty/trunk: lib/Jifty/Test/WWW

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Feb 21 16:21:44 EST 2006


Author: alexmv
Date: Tue Feb 21 16:21:42 2006
New Revision: 610

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm

Log:
 r9217 at zoq-fot-pik:  chmrr | 2006-02-21 16:20:32 -0500
  * Give us a way to get the CurrentUser from a MEch object during testing


Modified: jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm	(original)
+++ jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm	Tue Feb 21 16:21:42 2006
@@ -255,7 +255,8 @@
 
 =head2 session
 
-Returns the server-side session associated with this Mechanize object.
+Returns the server-side L<Jifty::Web::Session> object associated with
+this Mechanize object.
 
 =cut
 
@@ -289,4 +290,19 @@
     return $session->get_continuation($id);
 }
 
+=head2 current_user
+
+Returns the L<Jifty::CurrentUser> object or descendant, if any.
+
+=cut
+
+sub current_user {
+    my $self = shift;
+
+    my $session = $self->session;
+    return undef unless $session;
+
+    return $session->get('user');
+}
+
 1;


More information about the Jifty-commit mailing list