Download the PHP package rawsrc/exacodis without Composer

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

Exacodis

2022-08-15 PHP 8.0+ v.1.2.3

A PHP TESTING ENGINE

Exacodis is a very minimalist testing engine for PHP (very lightweight PHP testing framework). This engine is really far from others tools as it is very simple to use. No complex architecture, not even a huge testing engine, just the basic (and a little more) to help you to validate your PHP code.

Just 3 classes :

  1. One to pilot the tests (called Pilot),
  2. One to encapsulate and execute the test code (called Runner)
  3. One to produce the report (called Report)

And many helpers to check the returned values against the expected types and/or values. The helpers are not exhaustive, you'll be able to create easily yours.

INSTALLATION

IMPORTANT

Please note that your source code for tests must be perfectly clean: you can't override a test run nor a result nor a resource.
If you do, then the code will fail with an Exception until you fix it.

CHANGELOG

  1. Add the possibility to test any protected/private method from a class
  2. Add the possibility to test any protected/private static method from a class
  3. Does not break the compatibility with the previous version

HOW TO USE

I will directly use Exacodis to test itself as a learning support.

As Exacodis is a very lightweight engine, it's your responsibility to set up a test environment. Clearly, it's as simple as :

For projects with many classes, you must tell PHP how to load your classes either by including them or using an autoloader.

That's enough to start to test your code.

CONCEPT

LET'S START

To use everything you need to test your code, the engine is able to store and retrieve any resource you want (objects, arrays, scalar values, even unit tests...). Each resource must have a unique name, and you can't override it by error.

As written, a test is a simple snippet of code encapsulated in a Closure that returns a value :

Assertions use the standard helpers and of course yours.

You must know that assertions (->assertXXX) always apply to the latest run. If you want to change the current runner, then you can ask for it:

Then the assertions will apply to this one (see below: NESTED RUNS)

Here's the way to write a dynamic test:

You can write your test code as raw code, especially for complex test code.

To be able to test any protected or private (static or not) method, you must use $pilot->runClassMethod(...) instead of $pilot->run(...). The signature of the method is:

Please note:

Everything else is similar to the method $pilot->run().

Let's have an example from the php test file: Here all tests are equivalent:

Have a look at the call of a private method with two parameters and another call to a private static function():

The named parameters must follow the same order as defined in the function prototype.

The engine compute internally the data and, you can ask for a HTML report, as simply as:

You will find in the repository two reports: one totally passed and another one failed. You'll exactly see how the engine follows the runs and what kind of data is kept.

You can create your own helpers to validate any result using à simple Closure. Have a look at:

This assertion is one of the standard library and is injected right after the start of a new project. It is also possible to define a helper on the fly using $pilot->addHelper($name, $closure);.

For really complex tests, you can also define nested runs.

This is the only tricky point of Exacodis. This keeps the code more readable as there's no need to have tons of parameters for each function call.

Enjoy!

rawsrc


All versions of exacodis with dependencies

PHP Build Version
Package Version
Requires php Version >=8.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 rawsrc/exacodis contains the following files

Loading the files please wait ....