PHPackages                             suin/livexample - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. suin/livexample

ActiveLibrary[Testing &amp; Quality](/categories/testing)

suin/livexample
===============

Ensures your example codes works well by unit testing.

1.2.1(8y ago)31704MITPHPPHP &gt;=5.3

Since Nov 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/suin/livexample)[ Packagist](https://packagist.org/packages/suin/livexample)[ RSS](/packages/suin-livexample/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (2)Versions (6)Used By (4)

Livexample
==========

[](#livexample)

[![travis-ci-badge](https://camo.githubusercontent.com/4ff403e1b5ef5687a54a02abb1a6ce5402142a8346dd1464cb469ec190d5760b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7375696e2f6c69766578616d706c652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/suin/livexample) [![packagist-dt-badge](https://camo.githubusercontent.com/9e6b98e53a644ad727cf53f0f1b480a5c7a0cdc37874191d5b67769d3cc6ad40/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7375696e2f6c69766578616d706c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/suin/livexample) [![license-badge](https://camo.githubusercontent.com/4b762c733943479c90c7458bcad6eec37a459aa2881ce1c2685244dae2b194e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7375696e2f6c69766578616d706c652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md) [![release-version-badge](https://camo.githubusercontent.com/b167595aeaee7c1fec9f7133ec294f9fbda5295b28666e671df827e11781218b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7375696e2f6c69766578616d706c652e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/suin/livexample) [![php-version-badge](https://camo.githubusercontent.com/f5ec8278de2a2c82df41548ca51f92c03147011059d478de3c2e094e2a55b300/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7375696e2f6c69766578616d706c652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/f5ec8278de2a2c82df41548ca51f92c03147011059d478de3c2e094e2a55b300/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7375696e2f6c69766578616d706c652e7376673f7374796c653d666c61742d737175617265)

This is a documentation oriented testing framework for from PHP 5.3 to 7.x. Its purpose is ensure your example codes works by unit testing. Inspired by [Golang testing "Examples"](https://golang.org/pkg/testing/#hdr-Examples).

A simple test case example
--------------------------

[](#a-simple-test-case-example)

See an example below. The first section is example code which will be tested. The comment which begins with `Output` is test code.

```
