Download the PHP package eliashaeussler/phpunit-attributes without Composer

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

# PHPUnit Attributes [![Coverage](https://img.shields.io/coverallsCoverage/github/eliashaeussler/phpunit-attributes?logo=coveralls)](https://coveralls.io/github/eliashaeussler/phpunit-attributes) [![Maintainability](https://img.shields.io/codeclimate/maintainability/eliashaeussler/phpunit-attributes?logo=codeclimate)](https://codeclimate.com/github/eliashaeussler/phpunit-attributes/maintainability) [![CGL](https://img.shields.io/github/actions/workflow/status/eliashaeussler/phpunit-attributes/cgl.yaml?label=cgl&logo=github)](https://github.com/eliashaeussler/phpunit-attributes/actions/workflows/cgl.yaml) [![Tests](https://img.shields.io/github/actions/workflow/status/eliashaeussler/phpunit-attributes/tests.yaml?label=tests&logo=github)](https://github.com/eliashaeussler/phpunit-attributes/actions/workflows/tests.yaml) [![Supported PHP Versions](https://img.shields.io/packagist/dependency-v/eliashaeussler/phpunit-attributes/php?logo=php)](https://packagist.org/packages/eliashaeussler/phpunit-attributes)

A Composer library with additional attributes to enhance testing with PHPUnit.

🔥 Installation

Packagist Packagist Downloads

⚡ Usage

The library ships with a ready-to-use PHPUnit extension. It must be registered in your PHPUnit configuration file:

Some attributes can be configured with custom extension parameters. These must be added to the extension registration section like follows:

🎢 Attributes

The following attributes are shipped with this library:

#[RequiresClass]

Scope: Class & Method level

With this attribute, tests or test cases can be marked as to be only executed if a certain class exists. The given class must be loadable by the current class loader (which normally is Composer's default class loader).

Configuration

By default, test cases requiring non-existent classes are skipped. However, this behavior can be configured by using the handleMissingClasses extension parameter. If set to fail, test cases with missing classes will fail (defaults to skip):

Example

More examples #### Require single class Class level: Method level: #### Require single class and provide custom message Class level: Method level: #### Require single class and define custom outcome behavior Class level: Method level: #### Require multiple classes Class level: Method level:

#[RequiresPackage]

Scope: Class & Method level

This attribute can be used to define specific package requirements for single tests as well as complete test classes. A required package is expected to be installed via Composer. You can optionally define a version constraint and a custom message.

[!IMPORTANT] The attribute determines installed Composer packages from the build-time generated InstalledVersions class built by Composer. In order to properly read from this class , it's essential to include Composer's generated autoloader in your PHPUnit bootstrap script:

You can also pass the script as command option: phpunit --bootstrap vendor/autoload.php

Configuration

By default, test cases with unsatisfied requirements are skipped. However, this behavior can be configured by using the handleUnsatisfiedPackageRequirements extension parameter. If set to fail, test cases with unsatisfied requirements will fail (defaults to skip):

Example

More examples #### Require explicit Composer package Class level: Method level: #### Require any Composer package matching a given pattern Class level: Method level: #### Require Composer package with given version constraint Class level: Method level: #### Require Composer package and provide custom message Class level: Method level: #### Require Composer package and define custom outcome behavior Class level: Method level: #### Multiple requirements Class level: Method level:

🧑‍💻 Contributing

Please have a look at CONTRIBUTING.md.

⭐ License

This project is licensed under GNU General Public License 3.0 (or later).


All versions of phpunit-attributes with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0
phpunit/phpunit Version ^10.4 || ^11.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 eliashaeussler/phpunit-attributes contains the following files

Loading the files please wait ....