Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Acl] Fix for issue #9433 #9485

Closed
wants to merge 2 commits into from
Closed

[Acl] Fix for issue #9433 #9485

wants to merge 2 commits into from

Conversation

jillro
Copy link

@jillro jillro commented Nov 10, 2013

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #9433
License MIT
Doc PR

Two new test for issue #9433 :
testUpdateAclInsertingMultipleObjectFieldAcesThrowsDBConstraintViolations()
testUpdateAclDeletingObjectFieldAcesThrowsDBConstraintViolations()

The change to updateAces() line 857 is enough to make the first test succeed. When changing the order field value to a higher value, we must first change the value of the next entry (and all the next entries recursively) to preserve uniqueness of the order field in the database.

All the other changes are for the second test. In the former updateAcl() method, we commit the changes of the existing ACEs to the database before deleting or adding the new ones. We must delete the old ACEs before changing the existing ACEs in order to preserve uniqueness of the order field in the database.

fabpot added a commit that referenced this pull request Nov 22, 2013
This PR was squashed before being merged into the 2.2 branch (closes #9485).

Discussion
----------

[Acl] Fix for issue #9433

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9433
| License       | MIT
| Doc PR        |

Two new test for issue #9433 :
`testUpdateAclInsertingMultipleObjectFieldAcesThrowsDBConstraintViolations()`
`testUpdateAclDeletingObjectFieldAcesThrowsDBConstraintViolations()`

The change to `updateAces()` line 857 is enough to make the first test succeed. When changing the `order` field value to a higher value, we must first change the value of the next entry (and all the next entries recursively) to preserve uniqueness of the `order` field in the database.

All the other changes are for the second test. In the former `updateAcl()` method, we commit the changes of the existing ACEs to the database before deleting or adding the new ones. We must delete the old ACEs before changing the existing ACEs in order to preserve uniqueness of the `order` field in the database.

Commits
-------

a38fab9 [Acl] Fix for issue #9433
@fabpot fabpot closed this Nov 22, 2013
jderusse pushed a commit to jderusse/symfony that referenced this pull request Dec 15, 2020
This PR was squashed before being merged into the 2.2 branch (closes symfony#9485).

Discussion
----------

[Acl] Fix for issue symfony#9433

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#9433
| License       | MIT
| Doc PR        |

Two new test for issue symfony#9433 :
`testUpdateAclInsertingMultipleObjectFieldAcesThrowsDBConstraintViolations()`
`testUpdateAclDeletingObjectFieldAcesThrowsDBConstraintViolations()`

The change to `updateAces()` line 857 is enough to make the first test succeed. When changing the `order` field value to a higher value, we must first change the value of the next entry (and all the next entries recursively) to preserve uniqueness of the `order` field in the database.

All the other changes are for the second test. In the former `updateAcl()` method, we commit the changes of the existing ACEs to the database before deleting or adding the new ones. We must delete the old ACEs before changing the existing ACEs in order to preserve uniqueness of the `order` field in the database.

Commits
-------

a38fab9 [Acl] Fix for issue symfony#9433
derrabus added a commit to symfony/security-acl that referenced this pull request Apr 23, 2021
This PR was merged into the 3.0-dev branch.

Discussion
----------

Github actions setup and test fixes

Fixes #59 and closes #61

- This PR adds a github action setup, so that the test suite is actually executed on pr's (and pushes)
- Test fixes as there are quite some failing or risky tests

The github actions result can be viewed here before merge (https://github.com/acrobat/security-acl/actions)

There are 2 risky tests left, but I don't know what to do with them or how to fix them. The test names indicate that there should be an exception thrown but that doesn't happen and there are no asserts performed in those tests.

The tests/fix for an issue were added in symfony/symfony#9485

Commits
-------

8b94a32 Github actions setup and test fixes
derrabus added a commit to symfony/security-acl that referenced this pull request Apr 23, 2021
This PR was merged into the 3.x-dev branch.

Discussion
----------

Fix risky tests and deprecation warnings

This PR fixes the two risky tests and should (hopefully) give us a green CI.

The two tests in question were added in symfony/symfony#9485. As far as I read the PR, the tests should ensure that no exception is thrown. But because they don't assert anything, modern PHPUnit versions would flag the tests as risky. I avoid this issue by bumping the asserion count at the end of each test.

Commits
-------

6fd230c Fix risky tests and deprecation warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants