summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Acl/Dbal/AclProviderBenchmarkTest.php8
-rw-r--r--Tests/Acl/Dbal/AclProviderTest.php2
-rw-r--r--Tests/Acl/Domain/DoctrineAclCacheTest.php2
-rw-r--r--Tests/Core/Authorization/AccessDecisionManagerTest.php6
-rw-r--r--Tests/Core/Encoder/BCryptPasswordEncoderTest.php2
-rw-r--r--Tests/Core/Util/SecureRandomTest.php14
6 files changed, 17 insertions, 17 deletions
diff --git a/Tests/Acl/Dbal/AclProviderBenchmarkTest.php b/Tests/Acl/Dbal/AclProviderBenchmarkTest.php
index 2657001..0c35475 100644
--- a/Tests/Acl/Dbal/AclProviderBenchmarkTest.php
+++ b/Tests/Acl/Dbal/AclProviderBenchmarkTest.php
@@ -92,7 +92,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();
}
}
@@ -107,7 +107,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) {
@@ -178,7 +178,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 {
@@ -226,7 +226,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
while ($i <= 30) {
$mask |= 1 << rand(0, 30);
- $i++;
+ ++$i;
}
return $mask;
diff --git a/Tests/Acl/Dbal/AclProviderTest.php b/Tests/Acl/Dbal/AclProviderTest.php
index d701e22..ecd53db 100644
--- a/Tests/Acl/Dbal/AclProviderTest.php
+++ b/Tests/Acl/Dbal/AclProviderTest.php
@@ -130,7 +130,7 @@ class AclProviderTest extends \PHPUnit_Framework_TestCase
$i = 0;
foreach ($aces as $index => $ace) {
$this->assertEquals($i, $index);
- $i++;
+ ++$i;
}
$sid = $aces[0]->getSecurityIdentity();
diff --git a/Tests/Acl/Domain/DoctrineAclCacheTest.php b/Tests/Acl/Domain/DoctrineAclCacheTest.php
index 93c87c1..54f932d 100644
--- a/Tests/Acl/Domain/DoctrineAclCacheTest.php
+++ b/Tests/Acl/Domain/DoctrineAclCacheTest.php
@@ -72,7 +72,7 @@ class DoctrineAclCacheTest extends \PHPUnit_Framework_TestCase
$acl->insertClassFieldAce('foo', $sid, 1);
$acl->insertObjectAce($sid, 1);
$acl->insertObjectFieldAce('foo', $sid, 1);
- $id++;
+ ++$id;
if ($depth > 0) {
$acl->setParentAcl($this->getAcl($depth - 1));
diff --git a/Tests/Core/Authorization/AccessDecisionManagerTest.php b/Tests/Core/Authorization/AccessDecisionManagerTest.php
index cbb39c4..b416e95 100644
--- a/Tests/Core/Authorization/AccessDecisionManagerTest.php
+++ b/Tests/Core/Authorization/AccessDecisionManagerTest.php
@@ -145,13 +145,13 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase
protected function getVoters($grants, $denies, $abstains)
{
$voters = array();
- for ($i = 0; $i < $grants; $i++) {
+ for ($i = 0; $i < $grants; ++$i) {
$voters[] = $this->getVoter(VoterInterface::ACCESS_GRANTED);
}
- for ($i = 0; $i < $denies; $i++) {
+ for ($i = 0; $i < $denies; ++$i) {
$voters[] = $this->getVoter(VoterInterface::ACCESS_DENIED);
}
- for ($i = 0; $i < $abstains; $i++) {
+ for ($i = 0; $i < $abstains; ++$i) {
$voters[] = $this->getVoter(VoterInterface::ACCESS_ABSTAIN);
}
diff --git a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php
index 61e2afe..3f8ba86 100644
--- a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php
+++ b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php
@@ -40,7 +40,7 @@ class BCryptPasswordEncoderTest extends \PHPUnit_Framework_TestCase
public function testCostInRange()
{
- for ($cost = 4; $cost <= 31; $cost++) {
+ for ($cost = 4; $cost <= 31; ++$cost) {
new BCryptPasswordEncoder($cost);
}
}
diff --git a/Tests/Core/Util/SecureRandomTest.php b/Tests/Core/Util/SecureRandomTest.php
index 316b049..9fd1c16 100644
--- a/Tests/Core/Util/SecureRandomTest.php
+++ b/Tests/Core/Util/SecureRandomTest.php
@@ -35,17 +35,17 @@ class SecureRandomTest extends \PHPUnit_Framework_TestCase
{
$b = $this->getBitSequence($secureRandom, 20000);
$c = array();
- for ($i = 0; $i <= 15; $i++) {
+ for ($i = 0; $i <= 15; ++$i) {
$c[$i] = 0;
}
- for ($j = 1; $j <= 5000; $j++) {
+ for ($j = 1; $j <= 5000; ++$j) {
$k = 4 * $j - 1;
++$c[8 * $b[$k - 3] + 4 * $b[$k - 2] + 2 * $b[$k - 1] + $b[$k]];
}
$f = 0;
- for ($i = 0; $i <= 15; $i++) {
+ for ($i = 0; $i <= 15; ++$i) {
$f += $c[$i] * $c[$i];
}
@@ -64,7 +64,7 @@ class SecureRandomTest extends \PHPUnit_Framework_TestCase
$b = $this->getBitSequence($secureRandom, 20000);
$runs = array();
- for ($i = 1; $i <= 6; $i++) {
+ for ($i = 1; $i <= 6; ++$i) {
$runs[$i] = 0;
}
@@ -78,7 +78,7 @@ class SecureRandomTest extends \PHPUnit_Framework_TestCase
$currentRun = 0;
$lastBit = null;
- for ($i = 0; $i < 20000; $i++) {
+ for ($i = 0; $i < 20000; ++$i) {
if ($lastBit === $b[$i]) {
++$currentRun;
} else {
@@ -113,7 +113,7 @@ class SecureRandomTest extends \PHPUnit_Framework_TestCase
$longestRun = $currentRun = 0;
$lastBit = null;
- for ($i = 0; $i < 20000; $i++) {
+ for ($i = 0; $i < 20000; ++$i) {
if ($lastBit === $b[$i]) {
++$currentRun;
} else {
@@ -142,7 +142,7 @@ class SecureRandomTest extends \PHPUnit_Framework_TestCase
$b = $this->getBitSequence($secureRandom, 20000);
$Z = 0;
- for ($i = 0; $i < 5000; $i++) {
+ for ($i = 0; $i < 5000; ++$i) {
$Z += $b[$i] === $b[$i + $shift] ? 1 : 0;
}