Download the PHP package suin/livexample without Composer

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

Livexample

travis-ci-badge packagist-dt-badge php-version-badge

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".

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.

This example code is broken. The word "carol" is expected as output, however it does not appear. This test case fails, but you are able to know the example code has a problem and you may fix it.

How does it works?

Livexample does following steps:

  1. Find Output statement in the example code by parsing it.
  2. Run the code in PHPUnit and capture the output.
  3. Compare the expected output and the actual output.

Benefits

Sometimes example codes are broken, by adding new features, forgetting to update them, pull-requests which don't take care of example codes and so on.

Broken example codes are bad experience for library users.

By using Livexample, you will get benefits:

Features

Getting started

Install suin/livexample via Composer:

Add ExampleTest.php to your tests directory:

Run phpunit:

Assertion syntax

There are two syntax for assertion:

Tips: var_dump($object)

The var_dump() function prints object identifiers, which is #some-number next to the class name. Since the identifiers depend on execution environment, you can not hard-code it in the Output: statement. Instead of hard-coding the identifier, you may use a placeholder %d for number:

Tips: run an example script with php command

Why supports PHP 5.3 in 2017?

The official support for PHP 5.3 has ended, however, RHEL/CentOS keeps supporting PHP 5.3 even in 2017. The old PHP environments still remain in the running service today. Livexample is also suppoed to be used for refactoring such old environments.

Changelog

Please see CHANGELOG for more details.

Contributing

Please see CONTRIBUTING for more details. Please fix my English 😂.


All versions of livexample with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
phpunit/phpunit Version >=4.8.36 <7.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 suin/livexample contains the following files

Loading the files please wait ....