Download the PHP package andi3/phpunit-docgen without Composer

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

Documentation generator via PHPUnit

Usage

Require package:

composer require pretzlaw/phpunit-docgen

Write this in your phpunit.xml:

<listeners>
    <listener class="Pretzlaw\PHPUnit\DocGen\TestCaseListener">
        <arguments>
            <string>test-evidence.md</string>
        </arguments>
    </listener>
</listeners>

It will output all your doc comments as a nice markdown. This brings up a nice test evidence for unit tests or some kind of documentation when running integration tests.

Example / Best usage

Imaigne you need to describe an API or deliver the customer some test-evidence what is guaranteed by unit testing / integration test containing ...

Just a few doc comments can generate those documents. The following has been generated by the doc comments of such tests (Tests\FooControllerTest did this):

# Foo Fighters

This is an API for managing Foo. It allows:

- Create
- Read

Tests\FooController\CreateTest added this:

## How to create a new one?

Creating is easy as long as you stick to the range.

### Request

Do `POST /foo` with some data.

Tests\FooController\ShowTest added this:

## Read out all foo

### Restrictions

You can't see more than five. This is because ...

At least one will be at the drums. Because ...

Headings and Text

Within the FooControllerTest.php we have:

namespace Tests;

/**
 * Foo Fighters
 *
 * This is an API for managing Foo. It allows:
 *
 * - Create
 * - Read
 *
 * @since 1994
 */
class FooControllerTest {}

This is what turns into the first section (see example doc above). It simply puts the doc comment without @ attributes in the output.

Depth / Structure

Subsections will be done by parsing the namespace and (afterwards) by the methods a test contains:

namespace Tests\FooController;

/**
 * How to create a new one?
 * 
 * Creating is easy as long as you stick to the range.
 *
 */
class CreateTest {
  /**
   * Request
   *
   * Do `POST /foo` with some data.
   *
   */
  function testBar() {
    $this->assertTrue( (new FooController)->create() );
  }
}

This is how the second section is created (see above).

Append content to another heading

When you are within one test it means you are testing one context so sometimes you like to add documentation to some heading. Just use the heading for all those tests again:

/**
 * Read out all foo
 *
 */
class ShowTest {

  /**
   * Restrictions
   *
   * You can't see more than five. This is because ...
   */
  function testBar() {}

  /**
   * Restrictions
   *
   * At least one will be at the drums. Because ...
   */
  function testBaz() {}
}

Ignore one method or class / Do not print in doc

Cheers!


All versions of phpunit-docgen with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
phpunit/phpunit Version ~7|~8|~9
dompdf/dompdf Version ^0.8
michelf/php-markdown Version ^1.8
phpdocumentor/reflection-docblock Version ~5
symfony/finder Version ~3|~4|~5
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 andi3/phpunit-docgen contains the following files

Loading the files please wait ....