PHPackages                             ijvo/testbench - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ijvo/testbench

ActiveLibrary

ijvo/testbench
==============

Simple integration testing tool for Nette Framework applications

v3.1.4(2y ago)04.5k↓33.3%BSD-3-ClausePHPPHP &gt;=7.3

Since Mar 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/IJVo/testbench)[ Packagist](https://packagist.org/packages/ijvo/testbench)[ RSS](/packages/ijvo-testbench/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (21)Versions (42)Used By (0)

[![Build Status](https://github.com/IJVo/testbench/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/IJVo/testbench/actions)[![Latest stable](https://camo.githubusercontent.com/43687ad171ad7a7d9cb71bd098f8fbc76f7fe0093a68a80a9fe2a11bd5371c47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f494a566f2f7465737462656e63682e737667)](https://packagist.org/packages/IJVo/testbench)

Testbench
---------

[](#testbench)

Forked from

Update for Nette 3.0

Tested against PHP 7.4.

Please read [this wiki](https://github.com/mrtnzlml/testbench/wiki).

Heavily inspired by these GitHub projects:

- [Kdyby/TesterExtras](https://github.com/Kdyby/TesterExtras), [Librette](https://github.com/librette) tests, [Nette](https://github.com/nette) tests and [damejidlo/modular-testcase](https://github.com/damejidlo/modular-testcase)

And article(s):

- [Bootstrap your integration testing database](https://jiripudil.cz/blog/bootstrap-your-integration-testing-database) (Jiří Pudil)
- [Testování presenterů v Nette](http://zlml.cz/testovani-presenteru-v-nette) (me)

Simple test bench for Nette Framework projects
----------------------------------------------

[](#simple-test-bench-for-nette-framework-projects)

Write integration tests as simple as possible. This project helps you to write tests very quickly. DRY! The main goal of this project is to make testing very simple for everyone and help with the difficult start.

You can find few examples in this readme or take a look to the `tests` folder in this project.

Installation
------------

[](#installation)

```
$ composer require ijvo/testbench

```

Testbench itself doesn't need database. But if you want to use `Testbench\TDoctrine` or `Testbench\TNetteDatabase` trait you have to setup database for the first connection. You should use standard database configuration - nothing special. You can see example in `tests/tests.local.neon.dist` file. Empty database is good enough for Testbench. Supported databases are:

- Doctrine 2
- Nette\\Database

For another databases please send PR or open issue.

Minimal code
------------

[](#minimal-code)

At first you need classic bootstrap file (just example, DIY):

```
