Adding in pseudo-module for Crud serialization testing.

This commit is contained in:
Colin Kuskie 2009-05-07 15:38:49 +00:00
parent 0fd6447042
commit 676bc7f145

56
t/lib/WebGUI/Serialize.pm Normal file
View file

@ -0,0 +1,56 @@
package WebGUI::Serialize;
use base qw/WebGUI::Crud/;
use WebGUI::Utility;
#-------------------------------------------------------------------
=head2 crud_definition
WebGUI::Crud definition for this class.
=head3 tableName
crudSerialize
=head3 tableKey
serializeId
=head3 sequenceKey
None. Bundles have no sequence amongst themselves.
=head3 properties
=head4 someName
The name of a crud.
=head4 jsonField
JSON blob text field.
=cut
sub crud_definition {
my ($class, $session) = @_;
my $definition = $class->SUPER::crud_definition($session);
$definition->{tableName} = 'crudSerialize';
$definition->{tableKey} = 'serializeId';
$definition->{sequenceKey} = '';
my $properties = $definition->{properties};
$properties->{someName} = {
fieldType => 'text',
defaultValue => 'someName',
};
$properties->{jsonField} = {
fieldType => 'textarea',
defaultValue => [],
serialize => 1,
};
return $definition;
}
1;