Merge commit WebGUI_7.6.9-beta into survey-rfe

* commit 'tags/WebGUI_7.6.9-beta': (31 commits)
  Release 7.6.9-beta
  preparing for 7.6.9 release
  fixed: Exporting to static files can leak large amounts of memory
  fixed: HTTP Proxy doesn't serve new content to visitors
  use to_json and from_json in more places instead of encode_json and decode_json
  Document the heretofore missing date template variable in
  Qualify a chained method call when getting Workflow instances.  If the
  Attempt to fix IE6 bug
  fixed: ukplayer example is now loaded with swfobject.js released under the MIT licence, see gotcha's and /extras/ukplayer
  Added a style for printing Alumni pages
  Emails sent about low stock should have status unread, not completed.
  Moved draggable.js to extras/yui-webgui/build/layout since it is now a wrapper around YUI dragdrob
  Attributions in the changelog for a patch provided to fix a bug.
  whups, left in console.logs
  Updated draggable.js to wrap the YUI
  fixed #4137: Calendar Search page has extra head tags in body
  Fix a typo typo in the Operation/Workflow POD.
  Forward port Shelf view fix.  Was not displaying child shelves, only self.
  Forward port the PayDriver bug fixes from 7.5 branch.  Labels are always
  fixed #9264: new slideShow.swf uploaded in extras/ukplayer (United Knowledge/Arjan Widlak)
  ...

Conflicts:
	lib/WebGUI/Asset/Wobject/Survey.pm
This commit is contained in:
Patrick Donelan 2009-01-22 04:39:43 +00:00
commit 1376c8ae92
60 changed files with 999 additions and 1199 deletions

View file

@ -16,7 +16,7 @@ use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Session;
use Test::More tests => 14; # increment this value for each test you create
use Test::More tests => 15; # increment this value for each test you create
use WebGUI::Asset::Snippet;
my $session = WebGUI::Test->session;
@ -70,6 +70,24 @@ isnt ($wwwViewOutput, undef, 'www_view returns something');
my $editOutput = $snippet->www_edit;
isnt ($editOutput, undef, 'www_edit returns something');
$snippet->update({
title => "authMethod",
processAsTemplate => 1,
cacheTimeout => 1,
snippet => q|^SQL(select value from settings where name="<tmpl_var title>");|
});
my $sqlMacroAdded = exists $session->config->get('macros')->{'SQL'};
if (! $sqlMacroAdded) {
$session->config->addToHash('macros', 'SQL', 'SQL');
}
is($snippet->view(), 'WebGUI', 'Interpolating macros in works with template in the correct order');
if (! $sqlMacroAdded) {
$session->config->deleteFromHash('macros', 'SQL');
}
TODO: {
local $TODO = "Tests to make later";
ok(0, 'Test indexContent method');

View file

@ -33,7 +33,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
my $tests = 19;
my $tests = 18;
plan tests => 1 + $tests;
#----------------------------------------------------------------------------
@ -106,15 +106,6 @@ throws_deeply ( sub { $gateway = $pay->addPaymentGateway('WebGUI::Shop::PayDrive
'addPaymentGateway croaks without a configured class',
);
throws_deeply ( sub { $gateway = $pay->addPaymentGateway('WebGUI::Shop::PayDriver::Cash'); },
'WebGUI::Error::InvalidParam',
{
error => 'Must provide a label to create an object',
},
'addPaymentGateway requires a label',
);
throws_deeply ( sub { $gateway = $pay->addPaymentGateway('WebGUI::Shop::PayDriver::Cash', 'JAL'); },
'WebGUI::Error::InvalidParam',
{
@ -123,7 +114,7 @@ throws_deeply ( sub { $gateway = $pay->addPaymentGateway('WebGUI::Shop::PayDrive
'addPaymentGateway croaks without options to build a object with',
);
throws_deeply ( sub { $gateway = $pay->addPaymentGateway('WebGUI::Shop::PayDriver::Cash', 'JAL', {}); },
throws_deeply ( sub { $gateway = $pay->addPaymentGateway('WebGUI::Shop::PayDriver::Cash', {}); },
'WebGUI::Error::InvalidParam',
{
error => 'You must pass a hashref of options to create a new PayDriver object',
@ -135,9 +126,9 @@ my $options = {
enabled => 1,
label => 'Cold, stone hard cash',
};
$newDriver = $pay->addPaymentGateway('WebGUI::Shop::PayDriver::Cash', 'JAL', $options);
$newDriver = $pay->addPaymentGateway('WebGUI::Shop::PayDriver::Cash', $options);
isa_ok($newDriver, 'WebGUI::Shop::PayDriver::Cash', 'added a new, configured Cash driver');
is($newDriver->label, 'JAL', 'label passed correctly to paydriver');
is($newDriver->get('label'), 'Cold, stone hard cash', 'label passed correctly to paydriver');
#TODO: check if options are stored.
@ -212,14 +203,14 @@ my $otherOptions = {
enabled => 1,
label => 'Even harder cash',
};
$anotherDriver = $pay->addPaymentGateway('WebGUI::Shop::PayDriver::Cash', 'Pomade', $otherOptions);
$anotherDriver = $pay->addPaymentGateway('WebGUI::Shop::PayDriver::Cash', $otherOptions);
my $gateways = $pay->getPaymentGateways;
my @returnedIds = map {$_->label} @{ $gateways };
my @returnedIds = map {$_->get('label')} @{ $gateways };
cmp_bag(
\@returnedIds,
[
qw/Cash ITransact Pomade JAL/
qw/Cash ITransact/, 'Even harder cash', 'Cold, stone hard cash',
],
'getPaymentGateways returns all create payment drivers',
);

View file

@ -31,7 +31,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
my $tests = 49;
my $tests = 46;
plan tests => 1 + $tests;
#----------------------------------------------------------------------------
@ -150,31 +150,9 @@ cmp_deeply (
'create takes exception to not giving it a session object',
);
eval { $driver = WebGUI::Shop::PayDriver->create($session); };
eval { $driver = WebGUI::Shop::PayDriver->create($session, {}); };
$e = Exception::Class->caught();
isa_ok ($e, 'WebGUI::Error::InvalidParam', 'create takes exception to not giving it a label');
cmp_deeply (
$e,
methods(
error => 'Must provide a human readable label in the hashref of options',
),
'create takes exception to not giving it a hashref of options',
);
eval { $driver = WebGUI::Shop::PayDriver->create($session, 'Very human readable label'); };
$e = Exception::Class->caught();
isa_ok ($e, 'WebGUI::Error::InvalidParam', 'create takes exception to not giving it a hashref of options');
cmp_deeply (
$e,
methods(
error => 'Must provide a hashref of options',
),
'create takes exception to not giving it a hashref of options',
);
eval { $driver = WebGUI::Shop::PayDriver->create($session, 'Very human readable label', {}); };
$e = Exception::Class->caught();
isa_ok ($e, 'WebGUI::Error::InvalidParam', 'create takes exception to not giving it an empty hashref of options');
isa_ok ($e, 'WebGUI::Error::InvalidParam', 'create takes exception to giving it an empty hashref of options');
cmp_deeply (
$e,
methods(
@ -185,7 +163,6 @@ cmp_deeply (
# Test functionality
my $label = 'Human Readable Label';
my $options = {
label => 'Fast and harmless',
enabled => 1,
@ -193,19 +170,18 @@ my $options = {
receiptMessage => 'Pannenkoeken zijn nog lekkerder met spek',
};
$driver = WebGUI::Shop::PayDriver->create( $session, $label, $options );
$driver = WebGUI::Shop::PayDriver->create( $session, $options );
isa_ok ($driver, 'WebGUI::Shop::PayDriver', 'create creates WebGUI::Shop::PayDriver object');
like($driver->getId, $session->id->getValidator, 'driver id is a valid GUID');
my $dbData = $session->db->quickHashRef('select * from paymentGateway where paymentGatewayId=?', [ $driver->getId ]);
#diag ($driver->getId);
cmp_deeply (
$dbData,
{
paymentGatewayId => $driver->getId,
className => ref $driver,
label => $driver->label,
options => q|{"group":3,"receiptMessage":"Pannenkoeken zijn nog lekkerder met spek","label":"Fast and harmless","enabled":1}|,
},
'Correct data written to the db',
@ -213,7 +189,6 @@ cmp_deeply (
#######################################################################
#
# session