Download the PHP package phug/tester without Composer

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

Phug Tester

What is Phug Tester?

The Phug tester allow you to write unit tests easily for your Phug templates and get coverage of your tests.

As a PHPUnit extension, you can use all the features, options and same code you use usually running phpunit when your run the phug-tester command.

Installation

Install via Composer

Requirements:

Usage

You can couple it with PHP coverage data as phug-tester use PHPUnit and is compatible with all its options:

This will output in the CLI both PHP and Pug coverage summaries and it will dump as HTML PHP coverage in the directory coverage and Pug coverage in the sub-directory coverage/pug.

The Phug\Tester\TestCase is needed to use Pug utils such as renderFile or if you need to get both PHP and Pug coverage in a single command.

As an alternative if you extend an other class, you can use the trait:

Options

--pug-coverage-text display Pug coverage summary in the standard output of the CLI if present.

--pug-coverage-html dump coverage data as HTML in a directory, you have to specify the directory, example: --pug-coverage-html=/path/to/output/directory.

--pug-coverage-threshold test the coverage rate against a threshold, the command will fail if the threshold is not reached (status 1) and succeed if if does (status 0), you must specify a percentage between 0 and 100, example: --pug-coverage-threshold=90

Configuration

When using TestCaseTrait or extending TestCase, configuration methods are available to align the renderer behavior on your app test needs.

$cacheDirectory can be passed as an argument of the method.

By returning a new array in this method, you erase and replace all the options, but by using array_merge you can add an merge new options.

For example to add shared variables:


All versions of tester with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
ext-xdebug Version *
phug/renderer Version ^0.4.0
phpunit/phpunit Version ^6.0 || ^7.0 || ^8.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 phug/tester contains the following files

Loading the files please wait ....