Download the PHP package silvertipsoftware/factorygirl without Composer

On this page you can find all versions of the php package silvertipsoftware/factorygirl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package factorygirl

SilvertipSoftware/FactoryGirl

FactoryGirl is a (or hopes to be) a relatively faithful port of thoughtbot/factory_girl, a Ruby-land object factory library for testing.

Installation

Composer

Add silvertipsoftware/factorygirl to the require-dev section of your composer.json:

You can obviously choose any available version(s). Run composer update to get it.

Laravel

Add the FactoryGirl ServiceProvider to your Laravel application:

(optional) Add the following snippets to your app/config/app.php file:

Supported PHP Versions

Currently, PHP 5.3+ is supported. PHP 5.4 would make some things nicer, so that may change for future releases.

Documentation

See FactoryGirl documentation to get a feel for what it does and is used for. The syntax is hopefully a straightforward port to PHP.

Factory Definitions

The app/tests/factories.php file is used to store the factory definitions, and is automatically loaded on the first build/create on an object.

Basic Factory

defines a factory for a Room Eloquent model, and sets the name,capacity, and notes attributes to the given values. The model class name is inferred from the factory name. Where that's not intended, the model class name can also be specified:

Building/Creating Objects

With the factory defined above, your test code can do:

to get new room instances, which are not saved to the database. If you want them persisted, use create:

In either case, attributes may be overridden by passing an array as a second parameter:

Sequences

Sequences return a value based on a increasing index passed to the closure. Useful for creating uni que attributes in a standard way.

Then, in a factory, you can use the sequence by:

Associations

Given a factory for an account model, you can associate a user model to it with:

When a user is built, an account instance will be created and the account_id of user will be set to reference the new account. Currently, only belongsTo relations are supported, and the only "build strategy" is to save the associated object in the database.

Attribute values in the associated object can be overridden by passing an array:

The factory to use is inferred from the attribute name. If a different factory is desired, pass it to the associate call:

Or, specify both the factory and overrides:

Closures as Attributes

A closure can also be passed as an attribute value, and it is evaluated during model build. This lets you do more complex logic at build-time. This is particularly useful for 3-object associations. For example:

Attribute values are evaluated in the order they are given in the factory definition, so swapping account and location above would not have worked.

Inheritance

Factories can be chained to reuse common attribute definitions as follows:


All versions of factorygirl with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/database Version 4.*
illuminate/support Version 4.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package silvertipsoftware/factorygirl contains the following files

Loading the files please wait ....