PHPackages                             tiny/xml-assertions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. tiny/xml-assertions

ActiveLibrary[Testing &amp; Quality](/categories/testing)

tiny/xml-assertions
===================

Xml assertions for PHPUnit.

v0.1.0(7y ago)07PHP

Since Nov 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mike-shmatov/tiny-xml-assertions)[ Packagist](https://packagist.org/packages/tiny/xml-assertions)[ RSS](/packages/tiny-xml-assertions/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

tiny/xml-assertions
===================

[](#tinyxml-assertions)

This package provides XML assertions.

Install
-------

[](#install)

```
$ composer require --dev tiny/xml-assertions
```

Usage
-----

[](#usage)

Use `\Tiny\Testing\Assertions\Xml\XmlAssertionsTrait` in test case.

Available assertions:

```
/**
 * Assert that xpath exists.
 * @param string $xpath Xpath to search
 * @param mixed $domNode DOMDocument or DOMElement instance as a start for search
 * @param integer $count How many times xpath is expected to be found. Null if any.
 * @param string $message Message to be displayed by PHPUnit on failure.
 */
public static function assertXpathExists($xpath, $domNode, $count = null, $message = '');

/**
 *
 * @param string $xpath Xpath where value is expected to be found
 * @param mixed $value Expected value
 * @param mixed $domNode DOMDocument or DOMElement instance as a start for search
 * @param string $message Message to be displayed by PHPUnit on failure.
 */
public static function assertValueOnXpath($xpath, $value, $domNode, $message = '');
```

Demo
----

[](#demo)

Sample output for failures can be seen [in the sample file](demo/results.txt). The file contains output for demo test suite. If needed, the suite can be run via:

```
$ composer run-script demo
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2736d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4e80ff02096c1a482244fb4012d368ea8346c43657835f54a6d1736f5cea053?d=identicon)[tiny](/maintainers/tiny)

---

Top Contributors

[![mike-shmatov](https://avatars.githubusercontent.com/u/17006202?v=4)](https://github.com/mike-shmatov "mike-shmatov (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tiny-xml-assertions/health.svg)

```
[![Health](https://phpackages.com/badges/tiny-xml-assertions/health.svg)](https://phpackages.com/packages/tiny-xml-assertions)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
