2017 © Pedro PelĂĄez
 

testsuite phpcr-api-tests

PHP Content Repository compliance test suite

image

phpcr/phpcr-api-tests

PHP Content Repository compliance test suite

  • Wednesday, February 28, 2018
  • by dbu
  • Repository
  • 8 Watchers
  • 18 Stars
  • 19,108 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 24 Forks
  • 16 Open issues
  • 27 Versions
  • 0 % Grown

The README.md

PHPCR API tests

Test suite to test implementations against the PHPCR API interfaces., (*1)

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), (*2)

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., (*3)

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., (*4)

Usage

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

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

  • 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

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., (*7)

See the inc/AbstractLoader.php file to see what the ImplementationLoader has to do., (*8)

You can pass parameters from phpunit.xml into your bootstrap with the <var... syntax., (*9)

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, (*10)

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

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., (*12)

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:, (*13)

$ 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, (*14)

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

Dependencies

  • PHPUnit in PATH
  • PHPUnit in include_path

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., (*15)

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., (*16)

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., (*17)

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

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., (*19)

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., (*20)

Contributors

The Versions

28/02 2018

dev-master

9999999-dev http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

21/11 2017

2.1.19

2.1.19.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

12/11 2017

2.1.18

2.1.18.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

27/01 2017

2.1.17

2.1.17.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

27/01 2017

2.1.16

2.1.16.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

30/04 2016

dev-query-encoding-bug

dev-query-encoding-bug http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

23/04 2016

2.1.15

2.1.15.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

31/03 2016

dev-remove_node_other_session

dev-remove_node_other_session http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

12/02 2016

2.1.14

2.1.14.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

18/01 2016

2.1.13

2.1.13.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

22/11 2015

2.1.12

2.1.12.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

06/11 2015

2.1.11

2.1.11.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

18/10 2015

2.1.10

2.1.10.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

10/10 2015

2.1.9

2.1.9.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

09/10 2015

2.1.8

2.1.8.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

09/10 2015

2.1.7

2.1.7.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

15/08 2015

2.1.6

2.1.6.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

10/08 2015

2.1.5

2.1.5.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

02/05 2015

2.1.1.1

2.1.1.1 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

01/05 2015

2.1.4

2.1.4.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

13/02 2015

2.1.3

2.1.3.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

10/02 2015

dev-acl

dev-acl http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

13/12 2014

2.1.2

2.1.2.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

27/02 2014

dev-test-join-on-issamenode

dev-test-join-on-issamenode http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

08/01 2014

2.1.1

2.1.1.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

08/10 2013

2.1.0

2.1.0.0 http://phpcr.github.io

PHP Content Repository compliance test suite

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository

02/05 2013

dev-crx-tests

dev-crx-tests http://phpcr.github.com

PHP Content Repository compliance test suite

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0
  • phpcr/phpcr-implementation 2.1.*

 

by David Buchmann
by Lukas Kahwe Smith
by Daniel Barsotti
by Roland Schilter

testing phpcr contentrepository