Download the PHP package webfactory/doctrine-orm-test-infrastructure without Composer

On this page you can find all versions of the php package webfactory/doctrine-orm-test-infrastructure. 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 doctrine-orm-test-infrastructure

doctrine-orm-test-infrastructure

Tests

This library provides some infrastructure for tests of Doctrine ORM entities, featuring:

We use it to test Doctrine repositories and entities in Symfony applications. It's a lightweight alternative to the heavyweight functional tests suggested in the Symfony documentation (we don't suggest you should skip those - we just want to open another path).

In non-application bundles, where functional tests are not possible, it is our only way to test repositories and entities.

Installation

Install via composer (see http://getcomposer.org/):

composer require --dev webfactory/doctrine-orm-test-infrastructure

Usage

Migrating to attribute-based mapping configuration

The ORMInfrastructure::createWithDependenciesFor() and `ORMInfrastructure::createOnlyFor() methods by default assume that the Doctrine ORM mapping is provided through annotations. This has been deprecated in Doctrine ORM 2.x and is no longer be supported in ORM 3.0.

To allow for a seamless transition towards attribute-based or other types of mapping, a mapping driver can be passed when creating instances of the ORMInfrastructure.

If you wish to switch to attribute-based mappings, pass a new \Doctrine\ORM\Mapping\Driver\AttributeDriver($paths), where $paths is an array of directory paths where your entity classes are stored.

For hybrid (annotations and attributes) mapping configurations, you can use \Doctrine\Persistence\Mapping\Driver\MappingDriverChain. Multiple mapping drivers can be registered on the driver chain by providing namespace prefixes. For every namespace prefix, only one mapping driver can be used.

Testing the library itself

After installing the dependencies managed via composer, just run

vendor/bin/phpunit

from the library's root folder. This uses the shipped phpunit.xml.dist - feel free to create your own phpunit.xml if you need local changes.

Happy testing!

Changelog

1.5.0 -> 1.5.1

1.4.6 -> 1.5.0

Create file-backed database:

$configuration = new FileDatabaseConnectionConfiguration();
$infrastructure = ORMInfrastructure::createOnlyFor(
    MyEntity::class,
    $configuration
);
// Used database file:
echo $configuration->getDatabaseFile();

1.4.5 -> 1.4.6

Register entity type mapping:

$infrastructure->registerEntityMapping(EntityInterface::class, EntityImplementation::class);

Do not rely on this "feature" if you don't have to. Might be restructured in future versions.

1.4.4 -> 1.4.5

1.4.3 -> 1.4.4

Known Issues

Please note that apart from any open issues in this library, you may stumble upon any Doctrine issues. Especially take care of it's known sqlite issues.

Credits, Copyright and License

This package was first written by webfactory GmbH (Bonn, Germany) and received contributions from other people since then.

webfactory is a software development agency with a focus on PHP (mostly Symfony). If you're a developer looking for new challenges, we'd like to hear from you!

Copyright 2012 – 2024 webfactory GmbH, Bonn. Code released under the MIT license.


All versions of doctrine-orm-test-infrastructure with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
doctrine/annotations Version ^1.8|^2.0
doctrine/common Version ^2.11|^3.0
doctrine/dbal Version ^2.12|^3.0
doctrine/event-manager Version ^1.1|^2.0
doctrine/orm Version ^2.14|^3.0
doctrine/persistence Version ^2.0|^3.0
symfony/cache Version ^5.0|^6.0|^7.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 webfactory/doctrine-orm-test-infrastructure contains the following files

Loading the files please wait ....