PHP Classes

File: test/factories/user.php

Recommend this page to a friend!
  Classes of Eustaquio Rangel de Oliveira Jr.   torm   test/factories/user.php   Download  
File: test/factories/user.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: torm
Store and retrieve objects using ActiveRecord
Author: By
Last change: After initialize callback.
Connection now has a method to specify which error handling strategy is used.

And on development and test environments, the exception strategy
(PDO::ERRMODE_EXCEPTION) is set automatically.
Date: 10 years ago
Size: 1,701 bytes
 

Contents

Class file image Download
<?php
TORM
\Factory::define("user",array(
                    
"id" => time(),
                    
"name" => "Mary Doe",
                    
"email" => "mary@doe.com",
                    
"level" => 1,
                    
"code" => "12345",
                    
"created_at" => null,
                    
"updated_at" => null));

TORM\Factory::define("admin",array(
                    
"id" => time(),
                    
"name" => "Mary Doe",
                    
"email" => "mary@doe.com",
                    
"level" => 1,
                    
"code" => "12345",
                    
"created_at" => null,
                    
"updated_at" => null),
                     array(
"class_name"=>"User"));

TORM\Factory::define("unnamed_user",array(
                    
"id" => time(),
                    
"name" => null,
                    
"email" => "mary@doe.com",
                    
"level" => 1,
                    
"code" => "12345",
                    
"created_at" => null,
                    
"updated_at" => null),
                     array(
"class_name"=>"User"));

TORM\Factory::define("crazy_user",array(
                    
"id" => time(),
                    
"name" => "Mary Doe",
                    
"email" => "mary@doe.com",
                    
"level" => 1,
                    
"code" => "12345",
                    
"invalid_attr" => "invalid",
                    
"created_at" => null,
                    
"updated_at" => null),
                     array(
"class_name"=>"User"));
?>