Download the PHP package hautelook/alice-bundle without Composer

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

AliceBundle

A Symfony bundle to manage fixtures with nelmio/alice and fzaninotto/Faker.

The database support is done in FidryAliceDataFixtures. Check this project to know which database/ORM is supported.

Warning: this is the documentation for HautelookAliceBundle 2.0. If you want to check the documentation for 1.x, head this way.

Package version Build Status SensioLabsInsight Dependency Status Scrutinizer Code Quality Code Coverage Slack

When to use this bundle?

HautelookAliceBundle changed a lot, it first was acting as a simple bundle for nelmio/alice, it then started to ship some additional features to enrich it.

HautelookAliceBundle 1.x was the first milestone reaching a certain level of maturity in its usage:

HautelookAliceBundle 2.x changes a lot, although not so much. In 1.x, a lot of complexity was brought in the bundle due to nelmio/alice 2.x limitations and were at best workarounds (like the lack of handling of circular references). A lot of that complexity has been pushed back to nelmio/alice 3.x which has a much more flexible design. As a result:

Documentation

  1. Install
  2. Basic usage
  3. Database testing
  4. Advanced usage
    1. Enabling databases
    2. Environment specific fixtures
    3. Fixtures parameters
      1. Alice parameters
      2. Application parameters
    4. Use service factories
    5. Load fixtures in a specific order
      1. Load fixtures in a specific order
      2. Persisting the classes in a specific order
    6. Validation
  5. Custom Faker Providers
  6. Custom Alice Processors
  7. Resources

Installation

With Symfony Flex (recommended):

You're ready to use AliceBundle, and can jump to the next section!

Without Flex you will have to install doctrine/orm and register the bundles accordingly in app/AppKernel.php or wherever your Kernel class is located:

Configure the bundle to your needs, for example:

If you are using a non-flex architecture, you may want to use Resources/fixtures instead of fixtures.

Basic usage

Assuming you are using Doctrine, make sure you have the doctrine/doctrine-bundle and doctrine/data-fixtures packages installed.

Then create a fixture file in one of the following location:

Then simply load your fixtures with the doctrine command php bin/console hautelook:fixtures:load.

If you want to load the fixtures of a bundle only, do php bin/console hautelook:fixtures:load -b MyFirstBundle -b MySecondBundle.

See more.
Next chapter: Advanced usage

Database testing

The bundle provides nice helpers, inspired by Laravel, dedicated for database testing: RefreshDatabaseTrait, ReloadDatabaseTrait and RecreateDatabaseTrait. These traits allow to easily reset the database in a known state before each PHPUnit test: it purges the database then loads the fixtures.

They are particularly helpful when writing functional tests and when using Panther.

To improve performance, RefreshDatabaseTrait populates the database only one time, then wraps every tests in a transaction that will be rolled back at the end after its execution (regardless of if it's a success or a failure):

Sometimes, wrapping tests in transactions is not possible. For instance, when using Panther, changes to the database are made by another PHP process, so it wont work. In such cases, use the ReloadDatabase trait. It will purge the DB and load fixtures before every tests:

This strategy doesn't work when using Panther, because the changes to the database are done by another process, outside of the transaction.

Both traits provide several configuration options as protected static properties:

Use them in the setUpBeforeClass method.

Finally, if you're using in memory SQLite for your tests, use RecreateDatabaseTrait to create the database schema "on the fly":

Resources

Credits

This bundle was originaly developped by Baldur RENSCH and HauteLook. It is now maintained by Théo FIDRY.

Other contributors.

License


All versions of alice-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
doctrine/doctrine-bundle Version ^2.11.3
doctrine/data-fixtures Version ^1.7
doctrine/orm Version ^3.1
doctrine/persistence Version ^3.3.1
psr/log Version ^1.0 || ^2.0 || ^3.0
symfony/finder Version ^6.4 || ^7.0
symfony/framework-bundle Version ^6.4 || ^7.0
theofidry/alice-data-fixtures Version ^1.7
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 hautelook/alice-bundle contains the following files

Loading the files please wait ....