Download the PHP package nette/tester without Composer

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

Nette Tester: enjoyable unit testing

Downloads this Month Tests Latest Stable Version License

Introduction

Nette Tester is a productive and enjoyable unit testing framework. It's used by the Nette Framework and is capable of testing any PHP code.

Documentation is available on the Nette Tester website. Read the blog for new information.

Support Tester

Do you like Nette Tester? Are you looking forward to the new features?

Buy me a coffee

Thank you!

Installation

The recommended way to install Nette Tester is through Composer:

Alternatively, you can download the tester.phar file.

Collecting and processing code coverage information depends on Xdebug or PCOV extension, or PHPDBG SAPI.

Writing Tests

Imagine that we are testing this simple class:

So we create test file named greeting.test.phpt:

Thats' all!

Now we run tests from command-line using the tester command:

Nette Tester prints dot for successful test, F for failed test and S when the test has been skipped.

Assertions

This table shows all assertions (class Assert means Tester\Assert):

Testing exceptions:

Testing PHP errors, warnings or notices:

Testing private access methods:

Tips and features

Running unit tests manually is annoying, so let Nette Tester to watch your folder with code and automatically re-run tests whenever code is changed:

Running tests in parallel is very much faster and Nette Tester uses 8 threads as default. If you wish to run the tests in series use:

How do you find code that is not yet tested? Use Code-Coverage Analysis. This feature requires you have installed Xdebug or PCOV extension, or you are using PHPDBG SAPI. This will generate nice HTML report in coverage.html.

We can load Nette Tester using Composer's autoloader. In this case it is important to setup Nette Tester environment:

We can also test HTML pages. Let the template engine generate HTML code or download existing page to $html variable. We will check whether the page contains form fields for username and password. The syntax is the same as the CSS selectors:

For more inspiration see how Nette Tester tests itself.

Running tests

The command-line test runner can be invoked through the tester command (or php tester.php). Take a look at the command-line options:


All versions of tester with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0 <8.4
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 nette/tester contains the following files

Loading the files please wait ....