Adding in pseudo-module for Crud serialization testing.
This commit is contained in:
parent
0fd6447042
commit
676bc7f145
1 changed files with 56 additions and 0 deletions
56
t/lib/WebGUI/Serialize.pm
Normal file
56
t/lib/WebGUI/Serialize.pm
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue