DBIx-NinjaORM

 view release on metacpan or  search on metacpan

t/415-commit.t  view on Meta::CPAN

			'Commit.',
		);

		is(
			$output->{'action'},
			'update',
			'commit() called update().',
		);

		is_deeply(
			$output->{'data'},
			{
				field => 'value',
			},
			'Called update() with the correct data (excluding the primary key).',
		);
	}
);


# Test subclass with enough information to insert/update rows.
package DBIx::NinjaORM::Test;

use strict;
use warnings;

use lib 't/lib';
use LocalTest;

use base 'DBIx::NinjaORM';


sub static_class_info
{
	my ( $class ) = @_;

	my $info = $class->SUPER::static_class_info();

	$info->set(
		{
			default_dbh      => LocalTest::get_database_handle(),
			table_name       => 'tests',
			primary_key_name => 'test_id',
		}
	);

	return $info;
}

sub insert
{
	my ( $self, $data ) = @_;

	return
	{
		action => 'insert',
		data   => $data,
	};
}

sub update
{
	my ( $self, $data ) = @_;

	return
	{
		action => 'update',
		data   => $data,
	};
}

1;



( run in 1.270 second using v1.01-cache-2.11-cpan-39bf76dae61 )