Download the PHP package cdn77/test-utils without Composer

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

Cdn77 TestUtils

GitHub Actions Code Coverage Downloads Packagist Infection MSI

Contents

Installation

Features

Stub

Factory to create object through Reflection in order to bypass the constructor.


When testing method salute(), you only need the tested class to have property2 set, you don't want to worry about property1. Therefore in your test you can initialize MyEntity using Stub::create() like this:

It comes handy when class constructor has more arguments and most of them are not required for your test.

It is possible to extend stubs:

Test Checks

Test Checks are used to assert that tests comply with your suite's standards (are final, extend correct TestCaseBase etc.)

To run them, e.g. create a test case like in the following example:

Every test has group

Asserts that all tests have a #[Group('x')] attribute

:x:

:heavy_check_mark:

Configured in test provider as

Every test has same namespace as covered class

Asserts that all test share same namespace with class they're testing.
Consider src namespace Ns and test namespace Ns/Tests then for test Ns/Tests/UnitTest must exist class Ns/Unit.

You can use #[CoversClass] attribute to link test with tested class.
Use #[CoversNothing] attribute to skip this check.

Don't forget to enable requireCoverageMetadata="true" in phpunit config file.

:x:

:heavy_check_mark:

Configured in test provider as

Every test inherits from testcase base class

Consider you have a base for all tests and want each of them extend it.

:x:

:heavy_check_mark:

Configured in test provider as

Every test is final

Asserts all tests are final so they cannot be extended

:x:

:heavy_check_mark:

Configured in test provider as


All versions of test-utils with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
league/construct-finder Version ^1.4
phpunit/phpunit Version ^10.1 || ^11
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 cdn77/test-utils contains the following files

Loading the files please wait ....