Download the PHP package silvertipsoftware/fixtures without Composer

On this page you can find all versions of the php package silvertipsoftware/fixtures. 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 fixtures

Fixtures

A relatively faithful clone of ActiveRecord's fixture capability. Much of the docs from there are relevant, but some of the key points are below.

Fixtures are an easy way of setting up a test database to a known point, rather than continuously creating objects via factories in every test. The are not meant to create everything you'd ever need in a test, just the basics to form a reasonable starting point.

Fixtures are written in YAML, and there's one file per Eloquent model class.

Requirements & Caveats

Basic Usage

Fixtures by default live in the tests/fixtures directory, although that is configurable via the $fixturePath. Fixture file names and model names typically match, so to create a fixture for an \App\Framework model, create test/fixtures/frameworks.yml like:

When your tests run, these 3 database records will be created, and ids automatically assigned when needed. Accessor macros are also created, so referencing a fixture in a test is as easy as:

Relations

Relations that are instances of BelongsTo and BelongsToMany, which includes the morphing MorphTo and MorphToMany, can also be easily set up by name. Polymorphic relations must include the morph type (the classname by default, or whatever is in your morphMap) in parentheses. Fixtures sets the id (and type for polymorphisms) of the relation automatically, so you don't have to juggle manual ids.

Class Names

As mentioned above, namespaced models are not handled well yet. Fixtures defaults to using the default Laravel namespace of \App, but if you put models elsewhere you'll have to tell Fixtures what model class the fixture set is for.

In your YAML include a record like:

If the bulk of your models live in one namespace, you can change the default by setting $modelNamespace in your test class. So, we could eliminate the need for the above by:

Fixtures outside this namepsace will need model_class records. And this does not affect the string used for polymorphic relations.

Label Interpolation & Defaults

Including the string $LABEL in a column definition will replace that tag with the label of the fixture, which is often great for usernames, email addresses, etc:

For repetitive records like the above, a special DEFAULTS row can be specified using YAML anchors, so a longer user fixture set or a model with many fields to set could look like:

Label interpolation is done after default replacement, so this will generate users with the usernames mary, barb, etc.


All versions of fixtures with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
illuminate/support Version >=5.5
illuminate/database Version >=5.5
illuminate/filesystem Version >=5.5
symfony/yaml Version >=3.3
ramsey/uuid Version >=3.0
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/fixtures contains the following files

Loading the files please wait ....