« blib/lib/JMAP/Validation/Generators/ContactInformation.pm
↑ Summary
blib/lib/JMAP/Validation/Generators/String.pm »
| 1 | package JMAP::Validation::Generators::File; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use JMAP::Validation::Generators::String; | ||
| 7 | use JSON::Typist; | ||
| 8 | |||
| 9 | sub generate { | ||
| 10 | my $blobId = 1; | ||
| 11 | |||
| 12 | my @files; | ||
| 13 | |||
| 14 | foreach my $type (JMAP::Validation::Generators::String->generate(), undef) { | ||
| 15 | foreach my $name (JMAP::Validation::Generators::String->generate(), undef) { | ||
| 16 | foreach my $size (JSON::Typist::Number->new(int(rand(2**32))), undef) { | ||
| 17 | push @files, { | ||
| 18 | blobId => JMAP::Validation::Generators::String->generate(), | ||
| 19 | type => $type, | ||
| 20 | name => $name, | ||
| 21 | size => $size, | ||
| 22 | }; | ||
| 23 | |||
| 24 | $blobId++; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | return @files; | ||
| 30 | } | ||
| 31 | |||
| 32 | 1; |