test fixes and small cleanups

This commit is contained in:
Graham Knop 2009-03-26 21:44:55 +00:00
parent cab6c18372
commit c91878c9a3
5 changed files with 13 additions and 18 deletions

View file

@ -63,7 +63,7 @@ sub addSurveyQuestionTypes{
sub addWelcomeMessageTemplateToSettings {
my $session = shift;
print "\tAdding welcome message template to settings \n" unless $quiet;
print "\tAdding welcome message template to settings... " unless $quiet;
$session->db->write("insert into settings values ('webguiWelcomeMessageTemplate', 'PBtmpl0000000000000015');");
print "Done.\n" unless $quiet;
@ -72,7 +72,7 @@ sub addWelcomeMessageTemplateToSettings {
#----------------------------------------------------------------------------
sub addRssLimit {
my $session = shift;
print "\tAdding rssLimit to RSSCapable table, if needed... \n" unless $quiet;
print "\tAdding rssLimit to RSSCapable table, if needed... " unless $quiet;
my $sth = $session->db->read('describe RSSCapable rssCableRssLimit');
if (! defined $sth->hashRef) {
$session->db->write("alter table RSSCapable add column rssCableRssLimit integer");
@ -83,7 +83,7 @@ sub addRssLimit {
#----------------------------------------------------------------------------
sub addImageAnnotation {
my $session = shift;
print "\tAdding annotations to ImageAsset table, if needed... \n" unless $quiet;
print "\tAdding annotations to ImageAsset table, if needed... " unless $quiet;
my $sth = $session->db->read('describe ImageAsset annotations');
if (! defined $sth->hashRef) {
$session->db->write("alter table ImageAsset add column annotations mediumtext");
@ -94,7 +94,7 @@ sub addImageAnnotation {
#----------------------------------------------------------------------------
sub addStatisticsCacheTimeoutToMatrix{
my $session = shift;
print "\tAdding statisticsCacheTimeout setting to Matrix table... \n" unless $quiet;
print "\tAdding statisticsCacheTimeout setting to Matrix table... " unless $quiet;
$session->db->write("alter table Matrix add statisticsCacheTimeout int(11) not null default 3600");
print "Done.\n" unless $quiet;
}
@ -104,7 +104,7 @@ sub addStatisticsCacheTimeoutToMatrix{
# Describe what our function does
sub adSkuInstall {
my $session = shift;
print "\tCreate AdSku database table\n" unless $quiet;
print "\tCreate AdSku database table." unless $quiet;
$session->db->write("CREATE TABLE AdSku (
assetId VARCHAR(22) BINARY NOT NULL,
revisionDate BIGINT NOT NULL,
@ -118,10 +118,10 @@ sub adSkuInstall {
impressionDiscounts VARCHAR(1024) default '',
PRIMARY KEY (assetId,revisionDate)
)");
print "\tCreate Adsku crud table\n" unless $quiet;
print "\tCreate Adsku crud table.\n" unless $quiet;
use WebGUI::AssetCollateral::Sku::Ad::Ad;
WebGUI::AssetCollateral::Sku::Ad::Ad->crud_createTable($session);
print "\tinstall the AdSku Asset\n" unless $quiet;
print "\tInstalling the AdSku Asset.\n" unless $quiet;
$session->config->addToHash("assets", 'WebGUI::Asset::Sku::Ad' => { category => 'shop' } );
print "DONE!\n" unless $quiet;
}

View file

@ -359,7 +359,6 @@ delete the add if it gets refunded
sub onRefund {
my $self = shift;
my $item = shift;
my $ad;
my $iterator = WebGUI::AssetCollateral::Sku::Ad::Ad->getAllIterator($self->session,{
constraints => [ { "transactionItemId = ?" => $item->getId } ],
@ -367,7 +366,6 @@ sub onRefund {
my $crud = $iterator->();
my $ad = WebGUI::AdSpace::Ad->new($self->session,$crud->get('adId'));
$ad = WebGUI::AdSpace::Ad->new($self->session,$crud->get('adId'));
my $clicks = $ad->get('clicksBought') - $crud->get('clicksPurchased');
my $impressions = $ad->get('impressionsBought') - $crud->get('impressionsPurchased') ;
$ad->set({

View file

@ -1011,10 +1011,9 @@ sub www_getCompareFormData {
my $sort = shift || $session->scratch->get('matrixSort') || $self->get('defaultSort');
my $sortDirection = ' desc';
my @results;
my @listingIds = $self->session->form->checkList("listingId");
my @listingIds = $session->form->checkList("listingId");
$self->session->http->setMimeType("application/json");
$session->http->setMimeType("application/json");
my (@searchParams,@searchParams_sorted,@searchParamList,$searchParamList);
if($form->process("search")){
@ -1056,10 +1055,9 @@ assetData.revisionDate
and status='approved'
order by ".$sort.$sortDirection;
my $sth = $self->session->db->read($sql,[$self->getId]);
my $sth = $session->db->read($sql,[$self->getId]);
my @results;
my $gateway = $self->session->config->get("gateway");
if($form->process("search")){
while (my $result = $sth->hashRef) {
my $matrixListing_attributes = $session->db->buildHashRefOfHashRefs("
@ -1084,7 +1082,7 @@ assetData.revisionDate
}
}
$result->{assetId} =~ s/-/_____/g;
$result->{url} = $gateway."/".$result->{url};
$result->{url} = $session->url->gateway($result->{url});
push @results, $result;
}
}else{
@ -1093,7 +1091,7 @@ assetData.revisionDate
if(WebGUI::Utility::isIn($result->{assetId},@listingIds)){
$result->{checked} = 'checked';
}
$result->{url} = $gateway."/".$result->{url};
$result->{url} = $session->url->gateway($result->{url});
push @results, $result;
}
}

View file

@ -20,7 +20,7 @@ use base 'WebGUI::Crud';
#------------------------------------------------
=head crud_definition
=head1 crud_definition
defines the field this crud will contain

View file

@ -26,7 +26,6 @@ use WebGUI::Macro::Callback;
use Test::More; # increment this value for each test you create
my $numTests = 0;
plan skip_all => 'set CODE_COP to enable this test' unless $ENV{CODE_COP};
my $session = WebGUI::Test->session;
my $lib = WebGUI::Test->lib;