Download the PHP package kununu/testing-bundle without Composer

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

kununu testing-bundle

This bundle integrates with kununu/data-fixtures package allowing you to load fixtures in your tests. It also provides some utilities that makes testing easier, like a RequestBuilder that turns testing controllers more expressive. If you want to see an example of what this bundle can do for you click here.


Install

1. Add kununu/testing-bundle to your project

Please be aware that this bundle should not be used in production mode!

2. Enable Bundle

Enable the bundle at config/bundles.php for any environment.


Configuration

Create the file kununu_testing.yaml inside config/packages/test/. The configuration options of the bundle heavily depend on the fixture type. Check out the Load Fixtures section where you can find more options.

Tip If you are using the bundle on more than one environment, for example dev and test, and the configuration options are exactly the same you can import the kununu_testing.yaml like bellow in order to not duplicate the configurations.


Load Fixtures

This bundle integrates with kununu/data-fixtures allowing you to load fixtures in your tests. Currently, this bundle supports the following types of fixtures:


Schema Copier


This bundle also has a way of copying a database schema from one database to another.

See more:


Making a Request

Request Builder

This bundle provides a Request Builder which makes calling an endpoint more expressive.

WebTestCase

This bundle exposes the WebTestCase that you can extend which exposes a method that helps you testing your controllers without having to care about create the kernel. This class also allows you load fixtures in your tests.

Internally this method calls the Symfony client with:


Example

Let's imagine that you have a route named company_create which is protected (A valid access token needs to be provided) and expects a json to be provided in the body of the request with the data required to create a new company.

Using concepts provided by this bundle, like Loading Fixtures, the RequestBuilder and the WebTestCase our test could like:


Contribute

If you are interested in contributing read our contributing guidelines.


Tests

This repository takes advantages of GitHub actions to run tests when a commit is performed to a branch.

If you want to run the integration tests on your local machine you will need:

In your local environment to get everything ready for you, run ./tests/setupLocalTests.sh and follow the instructions. Then you can run the tests: vendor/bin/phpunit.


Continuous Integration Quality Gate Status


All versions of testing-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
symfony/framework-bundle Version ^5.4|^6.4
kununu/data-fixtures Version ^12.0
symfony/config Version ^5.4|^6.4
symfony/dependency-injection Version ^5.4|^6.4
symfony/http-kernel Version ^5.4|^6.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 kununu/testing-bundle contains the following files

Loading the files please wait ....