Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. #!/usr/bin/env perl
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. use Pessoal;
  7. use Test::More;
  8. use DDP;
  9. use utf8;
  10.  
  11. my $app = Pessoal->new;
  12.  
  13. my $familia = $app->familia->create(
  14. {
  15. familia => { nome => 'CHAVES' },
  16. fonte_renda => [{
  17. nome => "ROSELENA Chaves",
  18. cpf => 'xxxxxxxxxx',
  19. endereco => 'RUA FOO BAR N 54',
  20. cep => '65000000',
  21. cidade => 'SÃO LUÍS',
  22. uf => 'MA',
  23. telefone => '9999999',
  24. }],
  25. usuario => {
  26. usuario => 'MATHEUSLAILTON DE OLIVEIRA CHAVES',
  27. senha => 'perl',
  28. email => 'matheus@tchaves.com.br',
  29. }
  30. }
  31. );
  32.  
  33. ok defined $familia->id, "registrou um id";
  34. ok defined $familia->nome, "registrou uma nova família";
  35. ok $familia->id > 0;
  36. ok $app->familia->list->count > 0;
  37.  
  38. my $novo_nome = "Família Tchaves";
  39. $app->familia->update($familia->id, {nome => $novo_nome});
  40.  
  41. ok $app->familia->get($familia->id)->nome eq $novo_nome;
  42.  
  43. done_testing;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement