#!/usr/bin/perl -w use strict; use Test::More 'no_plan'; use Test::MockObject; use constant MODULE => 'XXXXXX::Security'; my $mock = Test::MockObject->new(); use_ok( MODULE ); can_ok( MODULE, 'new' ); $mock->add( cookie => sub {} ); my $sec = XXXXXX::Security->new; isa_ok( $sec, MODULE ); # testing null information my @results = $sec->validate( $mock ); ok( ! @results, 'No cookie, user, or pass should fail to validate'); #### sub add_product { my ( $self, $data ) = @_; my $categoryID = $data->{categoryID}; delete $data->{categoryID}; $self->_generic_insert( $data, 'products', DONT_COMMIT ); return if $self->error; my %category = ( productID => $self->_get_identity, categoryID => $categoryID ); $self->_generic_insert( \%category, 'category_product', COMMIT ); }