Download the PHP package phpcr/phpcr-api-tests without Composer

On this page you can find all versions of the php package phpcr/phpcr-api-tests. 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 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 http://www.day.com/specs/jcr/2.0/index.html)

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

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

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

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

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 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 <var... syntax.

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

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

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->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: http://github.com/jackalope/jackrabbit-importexport See the readme file of jackrabbit-importexport for details.

Contributors


All versions of phpcr-api-tests with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1 || ^8.0
phpcr/phpcr-implementation Version 2.1.*
phpunit/phpunit Version ^7.0 || ^8.0 || ^9.0 || ^10.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 phpcr/phpcr-api-tests contains the following files

Loading the files please wait ....