PHPackages                             edxml/test-corpus - 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. edxml/test-corpus

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

edxml/test-corpus
=================

A collection of portable unit tests for EDXML implementations

v3.0.0(3y ago)03MITMakefilePHP &gt;=7.4 | &gt;=8.0

Since Mar 13Pushed 3y ago1 watchersCompare

[ Source](https://github.com/edxml/test-corpus)[ Packagist](https://packagist.org/packages/edxml/test-corpus)[ Docs](http://edxml.org)[ RSS](/packages/edxml-test-corpus/feed)WikiDiscussions master Synced 1mo ago

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

[![license](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667) [![python package](https://github.com/edxml/test-corpus/workflows/Python%20package/badge.svg)](https://github.com/edxml/test-corpus/workflows/Python%20package/badge.svg) [![php package](https://github.com/edxml/test-corpus/workflows/PHP%20package/badge.svg)](https://github.com/edxml/test-corpus/workflows/PHP%20package/badge.svg)

The EDXML Test Corpus
---------------------

[](#the-edxml-test-corpus)

The EDXML test corpus is a collection of portable unit tests for EDXML implementations. Each unit test consists of one or more EDXML files. Implementations can be subjected to the tests by having them parse the files. The focus of the collection is on testing if implementations correctly detect invalid input and more generally on driving implementations off their happy path.

The collection is not complete in the sense that it provides any guarantees regarding the correctness or quality of implementations that pass the tests. Implementations must always be validated against the [EDXML Specification](http://www.edxml.org/spec).

The collection is also no substitute for unit tests that directly invoke the internal APIs of an implementation. The test corpus is complementary, adding particular value for testing the handling of invalid EDXML data which is typically difficult to produce using internal APIs.

The files are available in the `tests/` directory. For each EDXML version there is a subdirectory containing test files that are valid for that particular version of the EDXML specification. For example, the test files for EDXML version 3.0.0 are in the `tests/3/3.0/3.0.0` directory. Due to the EDXML specification using semantic versioning, the directories associated with minor or patch version updates only contain additional tests for testing specific changes introduced in that particular update. Each major version contains a completely new set of test files.

### How to Use

[](#how-to-use)

The test corpus can be used in your projects by cloning this repository. For PHP and Python projects you can also use a package manager to add the test corpus as a dependency. This repository includes both a [Python package](python/edxml-test-corpus) and a [Composer package](php) for PHP.

Testing if a file or set of files was parsed correctly is done in various ways, depending on the type of test. The collection for a specific EDXML version is subdivided in three categories containing tree different types of tests:

1. Valid data that implementations must ingest without problems (in `valid/`)
2. Invalid data that implementations must refuse to ingest (in `invalid/`)
3. Conflicting / non-conflicting data that implementations must detect (in `conflict/`)

These three types of tests are explained in detail below.

#### Testing valid data

[](#testing-valid-data)

These tests can be used to verify that an implementation can successfully parse valid EDXML data that is presented to it. Success can be determined in two different ways.

1. Parsing must not result in any errors produced by the implementation.
2. When the test includes a file named `expected.edxml`, the correctness of the internal representation that is the result of parsing the input data can be verified.

Testing the correctness of the internal representation of input EDXML data is done by having the implementation serialize this representation back to EDXML and comparing this to `expected.edxml`. When both EDXML data sets are equivalent, the test is successful. Given two EDXML data sets A and B equivalence means that

1. Each event in A must have an equivalent event in B, and the other way around. The meaning of equivalence for EDXML events is defined in the [EDXML Specification](http://www.edxml.org/spec).
2. The combination of all `` elements from A must be the equivalent of the combination of all `` elements from B, and the other way around. The meaning of equivalence for EDXML ontologies is defined in the [EDXML Specification](http://www.edxml.org/spec).

Each test is contained in its own subdirectory. The files that need to be ingested are named `input-xxx.edxml` where the `xxx` represents a sequence number. The files are intended to be ingested in the order as indicated by these sequence numbers. Depending on the implementation this may or may not make any difference.

#### Testing invalid data

[](#testing-invalid-data)

These tests can be used to verify that an implementation can successfully detect various errors in EDXML input data. Each of the EDXML files in this sub-collection must be refused by the implementation as being invalid.

There can be various aspects of EDXML data that can be invalid, like an ontology definition or the structure of an event. Implementations may produce specific types of exceptions for each of these cases. The files are grouped by these aspects to allow testing for specific types of exceptions being produced by the implementation.

#### Testing conflict handling

[](#testing-conflict-handling)

EDXML events can be versioned and versioned events can yield conflicts. These tests include events that are conflicting (in the `conflicting` subdirectory) as well as events that are not (in the `non-conflicting` subdirectory). EDXML implementations must correctly identify both.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

1162d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e4b7d52a612a67b8276aed11d9b8b6f4ae189764805ac9e9d44e1b8ef47feaa?d=identicon)[edxml](/maintainers/edxml)

---

Top Contributors

[![dtakken](https://avatars.githubusercontent.com/u/2066447?v=4)](https://github.com/dtakken "dtakken (96 commits)")

---

Tags

artificial-intelligencedata-integrationedxmlknowledge-representationedxml

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/edxml-test-corpus/health.svg)

```
[![Health](https://phpackages.com/badges/edxml-test-corpus/health.svg)](https://phpackages.com/packages/edxml-test-corpus)
```

###  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)
