created donation asset
This commit is contained in:
parent
a61ab090ee
commit
4a73cadf64
12 changed files with 353 additions and 22 deletions
|
|
@ -61,6 +61,7 @@ isnt($sku->processStyle, "", "Got some style information.");
|
|||
my $loadSku = WebGUI::Asset::Sku->newBySku($session, $sku->get("sku"));
|
||||
is($loadSku->getId, $sku->getId, "newBySku() works.");
|
||||
|
||||
$sku->purge;
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Cleanup
|
||||
|
|
|
|||
63
t/Asset/Sku/Donation.t
Normal file
63
t/Asset/Sku/Donation.t
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# vim:syntax=perl
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2008 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#------------------------------------------------------------------
|
||||
|
||||
# Write a little about what this script tests.
|
||||
#
|
||||
# This tests WebGUI::Asset::Sku::Donation
|
||||
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib "$FindBin::Bin/../../lib";
|
||||
use Test::More;
|
||||
use WebGUI::Test; # Must use this before any other WebGUI modules
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::Asset::Sku::Donation;
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Init
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
|
||||
plan tests => 4; # Increment this number for each test you create
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# put your tests here
|
||||
my $root = WebGUI::Asset->getRoot($session);
|
||||
my $sku = $root->addChild({
|
||||
className=>"WebGUI::Asset::Sku::Donation",
|
||||
title=>"Test Donation",
|
||||
defaultPrice => 50.00,
|
||||
});
|
||||
isa_ok($sku, "WebGUI::Asset::Sku::Donation");
|
||||
|
||||
is($sku->getPrice, 50.00, "Price should be 50.00");
|
||||
|
||||
$sku->applyOptions({
|
||||
price => 200.00
|
||||
});
|
||||
is($sku->getPrice, 200.00, "Price should be 200.00");
|
||||
|
||||
is($sku->getConfiguredTitle, "Test Donation (200)", "getConfiguredTitle()");
|
||||
|
||||
$sku->purge;
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Cleanup
|
||||
END {
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue