PHPackages                             honzavaclavik/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. honzavaclavik/testbench

ActiveLibrary

honzavaclavik/testbench
=======================

Simple integration testing tool for Nette Framework applications

v2.7.2(7y ago)06.7k4BSD-3-ClausePHPPHP ^7.1 || ^7.2

Since Mar 27Pushed 4y ago3 watchersCompare

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

READMEChangelog (7)Dependencies (19)Versions (38)Used By (0)

> At this moment I don't have time, energy and money to maintain this project. But it's a shame so if you depend on this project and you want to become a sponsor or develop it further please don't hesitate to contact me. Otherwise, I am not able to guarantee bright future of this repo... :)

[![Build Status](https://camo.githubusercontent.com/c891d3e023399d89a0069253a25649827540c2b9fbeab0cefd49bcca74584063/68747470733a2f2f7472617669732d63692e6f72672f686f6e7a617661636c6176696b2f7465737462656e63682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/honzavaclavik/testbench)

Tested against PHP 5.6 and 7.0. 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 honzavaclavik/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):

```
