Download the PHP package joomla/test without Composer
On this page you can find all versions of the php package joomla/test. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package test
Short Description Joomla Test Helper Package
License GPL-2.0-or-later
Homepage https://github.com/joomla-framework/test
Informations about the package test
The Test Package
This package is a collection of tools that make some of the jobs of unit testing easier.
TestHelper
Joomla\Test\TestHelper
is a static helper class that can be used to take some of the pain out of repetitive tasks whilst unit testing with PHPUnit.
Mocking
There are two methods that help with PHPUnit mock objects.
TestHelper::assignMockCallbacks
This helper method provides an easy way to configure mock callbacks in bulk.
TestHelper::assignMockReturns
This helper method provides an easy way to configure mock returns values in bulk.
Reflection
There are three methods that help with reflection.
TestHelper::getValue
The TestHelper::getValue
method allows you to get the value of any protected or private property.
This method should be used sparingly. It is usually more appropriate to use PHPunit's assertAttribute*
methods.
TestHelper::setValue
The TestHelper::setValue
method allows you to set the value of any protected or private property.
This method is useful for injecting values into an object for the purpose of testing getter methods.
TestHelper::invoke
The TestHelper::invoke
method allow you to invoke any protected or private method. After specifying the object and the method name, any remaining arguments are passed to the method being invoked.
Installation via Composer
Add "joomla/test": "~2.0"
to the require block in your composer.json and then run composer install
.
Alternatively, you can simply run the following from the command line: