From 676bc7f145f732883811fa4b2a786d8a98ac6f9d Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 7 May 2009 15:38:49 +0000 Subject: [PATCH] Adding in pseudo-module for Crud serialization testing. --- t/lib/WebGUI/Serialize.pm | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 t/lib/WebGUI/Serialize.pm diff --git a/t/lib/WebGUI/Serialize.pm b/t/lib/WebGUI/Serialize.pm new file mode 100644 index 000000000..e6cb4bc27 --- /dev/null +++ b/t/lib/WebGUI/Serialize.pm @@ -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;