Download the PHP package thomasweinert/phpunit-xpath-assertions without Composer

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

phpunit-xpath-assertions

Unit Tests

License Total Downloads Latest Stable Version

Xpath assertions and constraints for use with PHPUnit.

Example

Installation

Phar

If you're using PHPUnit as a PHAR, you can download this extension as PHAR, too. They the are available on the release page. Download the extension *.phar file into a directory and provide the directory in the PHPUnit configuration file.

Composer

If you use Composer to manage the dependencies of your project then you can add the PHPUnit example extension as a development-time dependency to your project:

Usage

The library provides traits that you can use to add the assertions to your TestCase.

Constraints

Use trait PHPUnit\Xpath\Constraint. They can be used with assertThat() or with Mocks.

self::matchesXpathExpression()

Validate if the provided Xpath expression matches something that is TRUE and not empty. It will fail if the expression returns an empty node list or an empty string or FALSE.

self::matchesXpathResultCount()

Returns true if the provided Xpath expression matches exactly the expected count of nodes.

self::equalToXpathResult()

If the expressions return a node list it compares the serialized XML of the matched nodes with the provided XML string or DOM. If the expression return a scalar uses a constraint depending on the type.

Assertions

Use trait PHPUnit\Xpath\Assert. These assertions are shortcuts for assertThat().

Namespaces

All methods have an optional argument that allow to provide an namespace definition.

JSON (>= 1.2.0)

The assertions can be used with JsonSerializable objects/arrays. They will be converted into a DOM representation internally.

Contributing

Contributions are welcome, please use the issue tracker to report bug and feature ideas.

Build a modified phar

This project includes build scripts to create your own phar file. To create a phar call ./build/build-phar.

Build a signed phar

To create a signed phar copy the dist.build.properties to build.properties and set the gpg.user. After that call ./build/build-phar package.


All versions of phpunit-xpath-assertions with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ~8.0.0
ext-dom Version *
ext-json Version *
phpunit/phpunit Version ^8.0 || ^9.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 thomasweinert/phpunit-xpath-assertions contains the following files

Loading the files please wait ....