give a man a hammer...
This commit is contained in:
parent
cb938487cb
commit
96ba0da75a
4 changed files with 5 additions and 5 deletions
|
|
@ -94,7 +94,7 @@ sub addPaymentGateway {
|
||||||
WebGUI::Error::InvalidParam->throw(error => q{Must provide a class to create an object})
|
WebGUI::Error::InvalidParam->throw(error => q{Must provide a class to create an object})
|
||||||
unless defined $requestedClass;
|
unless defined $requestedClass;
|
||||||
WebGUI::Error::InvalidParam->throw(error => q{The requested class is not enabled in your WebGUI configuration file}, param => $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})
|
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 };
|
unless defined($options) and ref $options eq 'HASH' and scalar keys %{ $options };
|
||||||
my $driver = eval { WebGUI::Pluggable::instanciate($requestedClass, 'create', [ $self->session, $options ]) };
|
my $driver = eval { WebGUI::Pluggable::instanciate($requestedClass, 'create', [ $self->session, $options ]) };
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ sub addShipper {
|
||||||
WebGUI::Error::InvalidParam->throw(error => q{Must provide a class to create an object})
|
WebGUI::Error::InvalidParam->throw(error => q{Must provide a class to create an object})
|
||||||
unless defined $requestedClass;
|
unless defined $requestedClass;
|
||||||
WebGUI::Error::InvalidParam->throw(error => q{The requested class is not enabled in your WebGUI configuration file}, param => $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})
|
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 };
|
unless defined($options) and ref $options eq 'HASH' and scalar keys %{ $options };
|
||||||
my $driver = eval { WebGUI::Pluggable::instanciate($requestedClass, 'create', [ $self->session, $options ]) };
|
my $driver = eval { WebGUI::Pluggable::instanciate($requestedClass, 'create', [ $self->session, $options ]) };
|
||||||
|
|
|
||||||
|
|
@ -980,7 +980,7 @@ sub www_addVATNumber {
|
||||||
my ($countryCode, $number) = $vatNumber =~ m/^([A-Z]{2})([A-Z0-9]+)$/;
|
my ($countryCode, $number) = $vatNumber =~ m/^([A-Z]{2})([A-Z0-9]+)$/;
|
||||||
|
|
||||||
my $errorMessage;
|
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 = $i18n->get('already has vat number') if @{ $self->getVATNumbers( $countryCode ) };
|
||||||
$errorMessage = $self->addVATNumber( $vatNumber ) unless $errorMessage;
|
$errorMessage = $self->addVATNumber( $vatNumber ) unless $errorMessage;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,12 @@ is_deeply($wf->getCrons, [], 'workflow has no crons');
|
||||||
|
|
||||||
isa_ok(WebGUI::Workflow->getList($session), 'HASH', 'getList returns a hashref');
|
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');
|
is(scalar keys %{WebGUI::Workflow->getList($session)}, 12, 'There are twelve enabled, default workflows, of all types, shipped with WebGUI');
|
||||||
|
|
||||||
$wf->set({enabled => 1});
|
$wf->set({enabled => 1});
|
||||||
ok($wf->get('enabled'), 'workflow is enabled');
|
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});
|
$wf->set({enabled => 0});
|
||||||
ok(!$wf->get('enabled'), 'workflow is disabled again');
|
ok(!$wf->get('enabled'), 'workflow is disabled again');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue