PHPackages                             phpcr/phpcr-api-tests - 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. phpcr/phpcr-api-tests

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

phpcr/phpcr-api-tests
=====================

PHP Content Repository compliance test suite

2.1.25(2y ago)2235.6k↑581%21[6 issues](https://github.com/phpcr/phpcr-api-tests/issues)[4 PRs](https://github.com/phpcr/phpcr-api-tests/pulls)4MITPHPPHP ^7.1 || ^8.0CI failing

Since May 2Pushed 7mo ago7 watchersCompare

[ Source](https://github.com/phpcr/phpcr-api-tests)[ Packagist](https://packagist.org/packages/phpcr/phpcr-api-tests)[ Docs](http://phpcr.github.io)[ RSS](/packages/phpcr-phpcr-api-tests/feed)WikiDiscussions 2.1.x Synced yesterday

READMEChangelog (10)Dependencies (2)Versions (33)Used By (4)

PHPCR API tests
===============

[](#phpcr-api-tests)

Test suite to test implementations against the PHPCR API interfaces.

The tests are organised by feature, with the numbers referencing the chapter numbers in the JCR v2.0 specification, JSR 283. (available at )

Some of the chapters have not yet been implemented. They have a file named `TODO`in the folder. The tests in all chapters are probably not feature complete, but steadily increasing. Help is of course welcome.

License
-------

[](#license)

This code is dual licensed under the MIT license and the Apache License Version 2.0. Please see the file LICENSE in this folder.

Usage
-----

[](#usage)

The phpcr-api-tests is a suite to test compliance for implementations of the java content repository specification.

This test suite is independent of an actual implementation. You need to do a couple of things to provide proper bootstrapping for your implementation:

- Add the api tests as submodule of your project, for example in a folder tests/api
- Copy phpunit.dist.xml to ../phpunit.xml and adapt as necessary.
- Implement the bootstrapping (see below)

### Bootstrapping

[](#bootstrapping)

You find a sample bootstrap.dist.php that you can copy to ../bootstrap.php and adjust to your implementation. Your bootstrap must ensure that the `ImplementationLoader` class extending the \\PHPCR\\Test\\AbstractLoader is available in the environment. The ImplementationLoader is used by the \\PHPCR\\Test\\BaseCase to acquire the PHPCR instances.

See the inc/AbstractLoader.php file to see what the ImplementationLoader has to do.

You can pass parameters from phpunit.xml into your bootstrap with the &lt;var... syntax.

### Fixtures loading

[](#fixtures-loading)

The ImplementationLoader must provide a fixture loader. The fixture names are generic, but all names map to .xml files in the fixtures folder. Those files are in the JCR system view format. This is the format that is used with SessionInterface::import and produced by SessionInterface::exportSystemView

If your implementation can not import that format, you will need to convert them into a suitable format.

We recommend not to use your phpcr implementation import() implementation to load the fixtures but something stripped down. If you use the import() implementation but have some error or bug in that implementation, you will get confusing errors on tests that should not fail.

Running the tests
-----------------

[](#running-the-tests)

Once this binding is working, run the tests with phpunit. If you use a normal php installation, this is usually along the lines of:

```
$ phpunit -c path/to/folder-with/phpunit.xml

```

You can run the tests for a specific chapter of the specification or just a single test case by specifying a path

```
$ phpunit -c path/to/folder-with/phpunit.xml path/to/suite/tests/NN_chaptername

```

Dependencies
------------

[](#dependencies)

- PHPUnit in PATH
- PHPUnit in include\_path

Implementation notes
--------------------

[](#implementation-notes)

This test suite is made to work with all implementations of PHPCR. Never write tests for implementation specific things in here - use your applications unit or functional tests for that.

All tests must extend from the PHPCR\\Test\\BaseCase which provides the static member $loader with the ImplementationLoader to load data. The BaseCase offers infrastructure to load fixtures efficiently and has some additional assertions that can be used by the tests. Read the comments in inc/BaseCase.php for details.

To improve test running speed, fixture are loaded in the setupBeforeClass method. If you need specific fixtures, pass the name to the parent class setupBeforeClass method, if you do not need fixtures at all, pass false.

For the read-only tests, we have just two fixtures that cover all cases: general/base and general/query

To only load fixtures once but reliably test write operations, have a fixture per test case class with nodes named after the test names. The BaseCase will put that name into $this-&gt;node for each test in setUp(). This way, each test has its own "root" node and does not influence the other tests.

To add or adjust fixtures, please keep them in the PHPCR system view format. If you work on Jackalope, you can use jackrabbit and the jack.jar tool to import and export data: See the readme file of jackrabbit-importexport for details.

Contributors
============

[](#contributors)

- Christian Stocker
- David Buchmann
- Tobias Ebnöther
- Roland Schilter
- Uwe Jäger
- Johannes Stark
- Lukas Kahwe Smith
- Benjamin Eberlei
- Daniel Barsotti

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community34

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 63.7% 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

Every ~164 days

Recently: every ~469 days

Total

28

Last Release

215d ago

PHP version history (4 changes)2.1.0PHP &gt;=5.3.0

2.1.16PHP ^5.6|7.0.x

2.1.17PHP ^5.6|^7.0

2.1.22PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/76576?v=4)[David Buchmann](/maintainers/dbu)[@dbu](https://github.com/dbu)

![](https://avatars.githubusercontent.com/u/20873?v=4)[Luke Smith](/maintainers/lsmith)[@lsmith](https://github.com/lsmith)

---

Top Contributors

[![dbu](https://avatars.githubusercontent.com/u/76576?v=4)](https://github.com/dbu "dbu (455 commits)")[![lsmith77](https://avatars.githubusercontent.com/u/300279?v=4)](https://github.com/lsmith77 "lsmith77 (68 commits)")[![bergie](https://avatars.githubusercontent.com/u/3346?v=4)](https://github.com/bergie "bergie (28 commits)")[![dantleech](https://avatars.githubusercontent.com/u/530801?v=4)](https://github.com/dantleech "dantleech (22 commits)")[![nicam](https://avatars.githubusercontent.com/u/182071?v=4)](https://github.com/nicam "nicam (18 commits)")[![rndstr](https://avatars.githubusercontent.com/u/32963?v=4)](https://github.com/rndstr "rndstr (17 commits)")[![ebi](https://avatars.githubusercontent.com/u/11541?v=4)](https://github.com/ebi "ebi (16 commits)")[![chregu](https://avatars.githubusercontent.com/u/47106?v=4)](https://github.com/chregu "chregu (15 commits)")[![Seldaek](https://avatars.githubusercontent.com/u/183678?v=4)](https://github.com/Seldaek "Seldaek (12 commits)")[![adou600](https://avatars.githubusercontent.com/u/1431387?v=4)](https://github.com/adou600 "adou600 (10 commits)")[![beberlei](https://avatars.githubusercontent.com/u/26936?v=4)](https://github.com/beberlei "beberlei (8 commits)")[![piotras](https://avatars.githubusercontent.com/u/232506?v=4)](https://github.com/piotras "piotras (8 commits)")[![petesiss](https://avatars.githubusercontent.com/u/235621?v=4)](https://github.com/petesiss "petesiss (8 commits)")[![markussr](https://avatars.githubusercontent.com/u/1172762?v=4)](https://github.com/markussr "markussr (6 commits)")[![ornicar](https://avatars.githubusercontent.com/u/140370?v=4)](https://github.com/ornicar "ornicar (4 commits)")[![rd-rk](https://avatars.githubusercontent.com/u/295347288?v=4)](https://github.com/rd-rk "rd-rk (3 commits)")[![danrot](https://avatars.githubusercontent.com/u/405874?v=4)](https://github.com/danrot "danrot (2 commits)")[![uwej711](https://avatars.githubusercontent.com/u/648874?v=4)](https://github.com/uwej711 "uwej711 (2 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (2 commits)")[![pavelvondrasek](https://avatars.githubusercontent.com/u/7081340?v=4)](https://github.com/pavelvondrasek "pavelvondrasek (2 commits)")

---

Tags

testingphpcrcontentrepository

### Embed Badge

![Health badge](/badges/phpcr-phpcr-api-tests/health.svg)

```
[![Health](https://phpackages.com/badges/phpcr-phpcr-api-tests/health.svg)](https://phpackages.com/packages/phpcr-phpcr-api-tests)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k136.1M985](/packages/brianium-paratest)[pestphp/pest

The elegant PHP Testing Framework.

11.6k72.2M20.4k](/packages/pestphp-pest)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k42.5M40.7k](/packages/orchestra-testbench)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69619.8M638](/packages/spatie-phpunit-snapshot-assertions)[liip/functional-test-bundle

This bundles provides additional functional test-cases for Symfony applications

65011.1M90](/packages/liip-functional-test-bundle)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4236.6M68](/packages/timacdonald-log-fake)

PHPackages © 2026

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