From 96ba0da75a49f8251381522b6ea136a2a5e3837d Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 20 Aug 2010 13:10:48 -0500 Subject: [PATCH] give a man a hammer... --- lib/WebGUI/Shop/Pay.pm | 2 +- lib/WebGUI/Shop/Ship.pm | 2 +- lib/WebGUI/Shop/TaxDriver/EU.pm | 2 +- t/Workflow.t | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/WebGUI/Shop/Pay.pm b/lib/WebGUI/Shop/Pay.pm index 4ebb03cb6..99730b2c0 100644 --- a/lib/WebGUI/Shop/Pay.pm +++ b/lib/WebGUI/Shop/Pay.pm @@ -94,7 +94,7 @@ sub addPaymentGateway { WebGUI::Error::InvalidParam->throw(error => q{Must provide a class to create an object}) unless defined $requestedClass; WebGUI::Error::InvalidParam->throw(error => q{The requested class is not enabled in your WebGUI configuration file}, param => $requestedClass) - unless isIn($requestedClass, (keys %{$self->getDrivers}) ); + unless exists $self->getDrivers->{$requestedClass}; WebGUI::Error::InvalidParam->throw(error => q{You must pass a hashref of options to create a new PayDriver object}) unless defined($options) and ref $options eq 'HASH' and scalar keys %{ $options }; my $driver = eval { WebGUI::Pluggable::instanciate($requestedClass, 'create', [ $self->session, $options ]) }; diff --git a/lib/WebGUI/Shop/Ship.pm b/lib/WebGUI/Shop/Ship.pm index 6e955894b..dd6b1d84d 100644 --- a/lib/WebGUI/Shop/Ship.pm +++ b/lib/WebGUI/Shop/Ship.pm @@ -71,7 +71,7 @@ sub addShipper { WebGUI::Error::InvalidParam->throw(error => q{Must provide a class to create an object}) unless defined $requestedClass; WebGUI::Error::InvalidParam->throw(error => q{The requested class is not enabled in your WebGUI configuration file}, param => $requestedClass) - unless isIn($requestedClass, (keys %{$self->getDrivers}) ); + unless exists $self->getDrivers->{$requestedClass}; WebGUI::Error::InvalidParam->throw(error => q{You must pass a hashref of options to create a new ShipDriver object}) unless defined($options) and ref $options eq 'HASH' and scalar keys %{ $options }; my $driver = eval { WebGUI::Pluggable::instanciate($requestedClass, 'create', [ $self->session, $options ]) }; diff --git a/lib/WebGUI/Shop/TaxDriver/EU.pm b/lib/WebGUI/Shop/TaxDriver/EU.pm index 36f33a10f..436735339 100644 --- a/lib/WebGUI/Shop/TaxDriver/EU.pm +++ b/lib/WebGUI/Shop/TaxDriver/EU.pm @@ -980,7 +980,7 @@ sub www_addVATNumber { my ($countryCode, $number) = $vatNumber =~ m/^([A-Z]{2})([A-Z0-9]+)$/; my $errorMessage; - $errorMessage = $i18n->get('illegal country code') unless isIn( $countryCode, keys %EU_COUNTRIES ); + $errorMessage = $i18n->get('illegal country code') unless exists $EU_COUNTRIES{$countryCode}; $errorMessage = $i18n->get('already has vat number') if @{ $self->getVATNumbers( $countryCode ) }; $errorMessage = $self->addVATNumber( $vatNumber ) unless $errorMessage; diff --git a/t/Workflow.t b/t/Workflow.t index 5c091377a..eb5956198 100644 --- a/t/Workflow.t +++ b/t/Workflow.t @@ -47,12 +47,12 @@ is_deeply($wf->getCrons, [], 'workflow has no crons'); isa_ok(WebGUI::Workflow->getList($session), 'HASH', 'getList returns a hashref'); -ok(!isIn($wfId, keys %{WebGUI::Workflow->getList($session)}), 'workflow not in enabled list'); +ok(! exists WebGUI::Workflow->getList($session)->{$wfId}, 'workflow not in enabled list'); is(scalar keys %{WebGUI::Workflow->getList($session)}, 12, 'There are twelve enabled, default workflows, of all types, shipped with WebGUI'); $wf->set({enabled => 1}); ok($wf->get('enabled'), 'workflow is enabled'); -ok(isIn($wfId, keys %{WebGUI::Workflow->getList($session)}), 'workflow in enabled list'); +ok(exists WebGUI::Workflow->getList($session)->{$wfId}, 'workflow in enabled list'); $wf->set({enabled => 0}); ok(!$wf->get('enabled'), 'workflow is disabled again');