Story Archive now plays nice with urlExtensions

This commit is contained in:
Paul Driver 2010-10-26 14:23:28 -07:00
parent e67ad18517
commit fa471df450
5 changed files with 51 additions and 9 deletions

View file

@ -39,6 +39,7 @@ use Scalar::Util qw( blessed );
use List::MoreUtils qw( any );
use Carp qw( carp croak );
use JSON qw( from_json to_json );
use Monkey::Patch qw( patch_object );
use Scope::Guard;
BEGIN {
@ -687,6 +688,24 @@ sub getMailFromQueue {
#----------------------------------------------------------------------------
=head2 overrideSetting (name, val)
Overrides WebGUI::Test->session->setting->get($name) to return $val until the
handle this method returns goes out of scope.
=cut
sub overrideSetting {
my ($class, $name, $val) = @_;
patch_object $class->session->setting => get => sub {
my $get = shift;
return $val if $_[1] eq $name;
goto &$get;
};
}
#----------------------------------------------------------------------------
=head2 cleanupAdminInbox ( )
Push a list of Asset objects onto the stack of assets to be automatically purged