Download the PHP package phpfui/phpunit-syntax-coverage without Composer

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

PHPUnitSyntaxCoverage Tests Latest Packagist release

PHPUnit Extension for complete PHP Syntax Code Coverage

This package will checks for easy to miss syntax errors in all your PHP code. It will also check all your classes to see if they are loadable, but without actually instantiating the class.

Often we accidently check in code with easily detectable syntax errors, but unless the file or class is actually loaded by PHP, we might not see the error. Often the file or class is syntaxically correct, but a method signature may not match an updated class or vendor library. Normally this would only be detectable at run time, but with PHPUnitSyntaxCoverage, you can make sure all files and classes are checked.

PHPUnitSyntaxCoverage uses PhpParser to check for basic syntax errors. It then uses ReflectionClass to load any classes that are found in the source without instantiating them. This will find additional errors (such as missing or changed base classes from a package update).

Requirements

Installation

Usage

Extend your unit tests from \PHPFUI\PHPUnitSyntaxCoverage\Extensions

You can use any of the following asserts:

Directory Testing

Instead of file by file testing, use assertValidPHPDirectory to test an entire directory. Any files added to the directory will be automatically tested.

The error message will include the offending file name and line number.

Use addSkipDirectory to add simple case insensitive file matching to skip specific directories / files.

Autoloading

You must make sure autoloading is correctly configured for all classes. This means you can't pass references to classes that will not resolve correctly in your source. Use addSkipDirectory if you have test code that may not validate correctly.

Namespace Testing

The assertValidPHPFile and assertValidPHPDirectory asserts will test for the proper namespace in the file path (for PSR-0 autoloading and fully pathed PSR-4 autoloading), but you can turn off namespace testing with skipNamespaceTesting or exclude a specific namespace tests with addSkipNamespace.

PHP Version

While this library only supports currently supported versions of PHP, you can create a project and point it to PHP 5.2 or higher. The default is to prefer PHP 7 code, but to prefer or only parse PHP 5, configure phpunit.xml(.dist) with

    <php>
        <env name="PHPFUI\PHPUnitSyntaxCoverage\Extensions_parser_type" value="X"/>
    </php>

Where X is one of the following numbers:

  1. Prefer PHP 7
  2. Prefer PHP 5
  3. Only PHP 7
  4. Only PHP 5

Examples

See examples

Full Class Documentation

PHPFUI/InstaDoc

License

PHPFUI is distributed under the MIT License.


All versions of phpunit-syntax-coverage with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0 <8.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 phpfui/phpunit-syntax-coverage contains the following files

Loading the files please wait ....