Download the PHP package raphhh/pumpkin without Composer

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

README

Latest Stable Version Build Status Scrutinizer Quality Score Code Coverage

What is Pumpkin?

Pumpkin helps you to organize the storage of your mocks for PHPUnit. It gives mocks objects and database resources when you execute a test.

How to start?

You just have to add the Pumpkin package in your composer.json and update your project.

What can I do?

Get the current test

Usually, when you use PHPUnit, you create a new test class extending \PHPUnit_Framework_TestCase. Instead, with Pumpkin, you have to extend \Pumpkin\TestCase.

\Pumpkin\TestCase extends \PHPUnit_Framework_TestCase, so you have the same interface as if you use PHPUnit.

But you can also know the current test with \Pumpkin\TestCase::getTest(). You receive a \Pumpkin\Test\Test object which reflects the current method of the test.

The current test is the method executed by PHPUnit and containing your assertions. Typically, this is a test* method.

For example

With this method you can reflected the method of the executed test, retrieve annotations, ... anything!

Note that if you do not want to extend \Pumpkin\TestCase, you can also directly extend \PHPUnit_Framework_TestCase and use the trait \Pumpkin\Test\TestCaseTrait.

Get mocks of the current test

You can retrieve mocks of a the current test. Mocks objects must be user objects. They are declared in a specific file for the current test.

The file is located in the following path:

This path can start from the test directory or from a parent one.

You can declare as many mocks as you want in this file.

For example:

Reset the database with specific data for the current test

When you want to mock databases with PHPUnit, you need to use \PHPUnit_Extensions_Database_TestCase. Instead, with Pumpkin, you have to extend \Pumpkin\Database\TestCase.

\Pumpkin\Database\TestCase extends \PHPUnit_Extensions_Database_TestCase, so you have the same interface as if you use PHPUnit.

Note that if you do not want to extend \Pumpkin\Database\TestCase, you can also directly extend \PHPUnit_Extensions_Database_TestCase and use the trait \Pumpkin\Test\Database\TestCaseTrait.

The annotations

But you can also specify the tables you want to load for the current test. This is done in the comments of the current test, with the @db tag.

The data file

The data are stored in a file with the following path:

Currently, Pumpkin support only csv files, but it can be evolved in future.

Your data can be specific for the current test, or be common with several tests. Everything is determined by the data file path. If you want specific data, you have to locate the data file in the directory of your test. If you want common data, you have to locate the data file in a common directory of your tests.

The database config

If you want to load your mocked data, you have to allow PHPUnit to access to your database. With Pumpkin you have just to specify your config in the phpunit.xml.

For example


All versions of pumpkin with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
phpunit/phpunit Version *
phpunit/dbunit Version *
raphhh/trex-parser Version ^1.1
doctrine/annotations Version ^1.2
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 raphhh/pumpkin contains the following files

Loading the files please wait ....