ezsystems/ezp-next — pull request #192 by manuelpichler (2012-12-14 09:16:32+00:00)
Title: Integrationtests limitation

This branch adds 27 new integration tests for the limitation implementation in the public api. Currently we provide integration tests for:

- ContentTypeLimitation
- LanguageLimitation
- LocationLimitation
- OwnerLimitation
- ParentContentTypeLimitation
- ParentDepthLimitation
- ParentUserGroupLimitation
- SectionLimitation
- StateLimitation
- UserGroupLimitation

Missing are tests for the ```RoleLimitation```(where no SPI implementation exists) and tests for the ```SiteaccessLimitation```(not completely implemented) at the moment.

When executing these tests you will get two errors and four failing tests.

```
$ phpunit -c phpunit-integration-legacy.xml --group limitation
PHPUnit 3.7.10 by Sebastian Bergmann.

Configuration read from /home/manu/Dokumente/private/php-company/qafoo/projects/ezp-next/phpunit-integration-legacy.xml

.......EF............EF..FF

Time: 17 seconds, Memory: 39.75Mb

There were 2 errors:

[...snipp...]

--

There were 4 failures:

[...snipp...]

FAILURES!
Tests: 27, Assertions: 23, Failures: 4, Errors: 2.
```

Two of the test failures are raised manually, because the ```evaluate()``` method of the ```UserGroupLimitation``` results in an endless loop. The other failing and error tests are caused by ```BadStateException```s and ```InvalidArgumentException```s. As far as I can see these Exceptions aren't correct, but if I am wrong please write me a line and I will try to fix these tests.