summaryrefslogtreecommitdiffstats
path: root/Tests/Acl
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Acl')
-rw-r--r--Tests/Acl/Dbal/AclProviderBenchmarkTest.php8
-rw-r--r--Tests/Acl/Dbal/MutableAclProviderTest.php11
-rw-r--r--Tests/Acl/Domain/AclTest.php4
-rw-r--r--Tests/Acl/Domain/AuditLoggerTest.php2
-rw-r--r--Tests/Acl/Domain/PermissionGrantingStrategyTest.php3
-rw-r--r--Tests/Acl/Domain/SecurityIdentityRetrievalStrategyTest.php2
6 files changed, 17 insertions, 13 deletions
diff --git a/Tests/Acl/Dbal/AclProviderBenchmarkTest.php b/Tests/Acl/Dbal/AclProviderBenchmarkTest.php
index 8f6a30c..e930b19 100644
--- a/Tests/Acl/Dbal/AclProviderBenchmarkTest.php
+++ b/Tests/Acl/Dbal/AclProviderBenchmarkTest.php
@@ -96,7 +96,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
$this->insertEntryStmt = $this->con->prepare('INSERT INTO acl_entries (id, class_id, object_identity_id, field_name, ace_order, security_identity_id, mask, granting, granting_strategy, audit_success, audit_failure) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
$this->insertOidAncestorStmt = $this->con->prepare('INSERT INTO acl_object_identity_ancestors (object_identity_id, ancestor_id) VALUES (?, ?)');
- for ($i=0; $i<40000; $i++) {
+ for ($i = 0; $i<40000; $i++) {
$this->generateAclHierarchy();
}
}
@@ -111,7 +111,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
protected function generateAclLevel($depth, $parentId, $ancestors)
{
$level = count($ancestors);
- for ($i=0,$t=rand(1, 10); $i<$t; $i++) {
+ for ($i = 0,$t = rand(1, 10); $i<$t; $i++) {
$id = $this->generateAcl($this->chooseClassId(), $parentId, $ancestors);
if ($level < $depth) {
@@ -165,7 +165,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
$this->insertSidStmt->execute(array(
$id,
$this->getRandomString(rand(5, 30)),
- rand(0, 1)
+ rand(0, 1),
));
$id += 1;
@@ -182,7 +182,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
$sids = array();
$fieldOrder = array();
- for ($i=0; $i<=30; $i++) {
+ for ($i = 0; $i <= 30; $i++) {
$fieldName = rand(0, 1) ? null : $this->getRandomString(rand(10, 20));
do {
diff --git a/Tests/Acl/Dbal/MutableAclProviderTest.php b/Tests/Acl/Dbal/MutableAclProviderTest.php
index 00a2228..832a896 100644
--- a/Tests/Acl/Dbal/MutableAclProviderTest.php
+++ b/Tests/Acl/Dbal/MutableAclProviderTest.php
@@ -88,7 +88,8 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
try {
$provider->findAcl($oid);
$this->fail('ACL has not been properly deleted.');
- } catch (AclNotFoundException $notFound) { }
+ } catch (AclNotFoundException $notFound) {
+ }
}
public function testDeleteAclDeletesChildren()
@@ -103,7 +104,8 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
try {
$provider->findAcl(new ObjectIdentity(1, 'Foo'));
$this->fail('Child-ACLs have not been deleted.');
- } catch (AclNotFoundException $notFound) { }
+ } catch (AclNotFoundException $notFound) {
+ }
}
public function testFindAclsAddsPropertyListener()
@@ -148,7 +150,7 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
'parent' => array(
'object_identifier' => '1',
'class_type' => 'anotherFoo',
- )
+ ),
));
$propertyChanges = $this->getField($provider, 'propertyChanges');
@@ -288,7 +290,8 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
try {
$provider->updateAcl($acl1);
$this->fail('Provider failed to detect a concurrent modification.');
- } catch (ConcurrentModificationException $ex) { }
+ } catch (ConcurrentModificationException $ex) {
+ }
}
public function testUpdateAcl()
diff --git a/Tests/Acl/Domain/AclTest.php b/Tests/Acl/Domain/AclTest.php
index 4b67e62..29acc3a 100644
--- a/Tests/Acl/Domain/AclTest.php
+++ b/Tests/Acl/Domain/AclTest.php
@@ -128,7 +128,7 @@ class AclTest extends \PHPUnit_Framework_TestCase
$acl = $this->getAcl();
$listener = $this->getListener(array(
- $property, 'aceOrder', $property, 'aceOrder', $property
+ $property, 'aceOrder', $property, 'aceOrder', $property,
));
$acl->addPropertyChangedListener($listener);
@@ -358,7 +358,7 @@ class AclTest extends \PHPUnit_Framework_TestCase
$acl->{'insert'.$type}('foo', new UserSecurityIdentity('foo', 'Foo'), 1);
$listener = $this->getListener(array(
- 'mask', 'mask', 'strategy'
+ 'mask', 'mask', 'strategy',
));
$acl->addPropertyChangedListener($listener);
diff --git a/Tests/Acl/Domain/AuditLoggerTest.php b/Tests/Acl/Domain/AuditLoggerTest.php
index a0f38eb..c8522b4 100644
--- a/Tests/Acl/Domain/AuditLoggerTest.php
+++ b/Tests/Acl/Domain/AuditLoggerTest.php
@@ -28,7 +28,7 @@ class AuditLoggerTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue($audit))
;
- $ace
+ $ace
->expects($this->never())
->method('isAuditFailure')
;
diff --git a/Tests/Acl/Domain/PermissionGrantingStrategyTest.php b/Tests/Acl/Domain/PermissionGrantingStrategyTest.php
index d200d2b..4698a72 100644
--- a/Tests/Acl/Domain/PermissionGrantingStrategyTest.php
+++ b/Tests/Acl/Domain/PermissionGrantingStrategyTest.php
@@ -154,7 +154,8 @@ class PermissionGrantingStrategyTest extends \PHPUnit_Framework_TestCase
try {
$strategy->isGranted($acl, array($requiredMask), array($sid));
$this->fail('The ACE is not supposed to match.');
- } catch (NoAceFoundException $noAce) { }
+ } catch (NoAceFoundException $noAce) {
+ }
} else {
$this->assertTrue($strategy->isGranted($acl, array($requiredMask), array($sid)));
}
diff --git a/Tests/Acl/Domain/SecurityIdentityRetrievalStrategyTest.php b/Tests/Acl/Domain/SecurityIdentityRetrievalStrategyTest.php
index f649653..e5fb4ed 100644
--- a/Tests/Acl/Domain/SecurityIdentityRetrievalStrategyTest.php
+++ b/Tests/Acl/Domain/SecurityIdentityRetrievalStrategyTest.php
@@ -103,7 +103,7 @@ class SecurityIdentityRetrievalStrategyTest extends \PHPUnit_Framework_TestCase
array('guest', array('ROLE_FOO'), 'anonymous', array(
new RoleSecurityIdentity('ROLE_FOO'),
new RoleSecurityIdentity('IS_AUTHENTICATED_ANONYMOUSLY'),
- ))
+ )),
);
}