Skip to content

Commit 37f9ac7

Browse files
committed
Fixed benchmarks
1 parent f3bb7f1 commit 37f9ac7

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

benchmarks/BaseBench.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PhpBench\BenchCase;
66
use PHPCR\NodeInterface;
77

8-
abstract class BaseBench implements BenchCase
8+
abstract class BaseBench
99
{
1010
const ROOT_NAME = 'bench';
1111
const ROOT_PATH = '/bench';

benchmarks/Query/InsertBench.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
namespace PHPCR\Benchmark\Query;
44

5-
use PhpBench\BenchIteration;
65
use PHPCR\Benchmark\BaseBench;
6+
use PhpBench\Benchmark;
7+
use PhpBench\Benchmark\Iteration;
78

8-
class InsertBench extends BaseBench
9+
class InsertBench extends BaseBench implements Benchmark
910
{
1011
/**
1112
* @description Insert nodes
1213
* @paramProvider provideNbNodes
1314
* @beforeMethod beforeResetWorkspace
1415
* @iterations 2
1516
*/
16-
public function benchInsertNodes(BenchIteration $iteration)
17+
public function benchInsertNodes(Iteration $iteration)
1718
{
1819
$this->createNodes($this->getRootNode(), $iteration->getParameter('nb_nodes'), array(
1920
'string' => 'Hello',

benchmarks/Query/QueryBench.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
namespace PHPCR\Benchmark\Query;
44

5-
use PhpBench\BenchIteration;
65
use PHPCR\Benchmark\BaseBench;
6+
use PhpBench\Benchmark;
7+
use PhpBench\Benchmark\Iteration;
78

8-
class QueryBench extends BaseBench
9+
class QueryBench extends BaseBench implements Benchmark
910
{
1011
/**
1112
* @description Run a select query
@@ -14,7 +15,7 @@ class QueryBench extends BaseBench
1415
* @beforeMethod beforeCreateNodes
1516
* @iterations 1
1617
*/
17-
public function benchQuery(BenchIteration $iteration)
18+
public function benchQuery(Iteration $iteration)
1819
{
1920
$query = $this->getQueryManager()->createQuery($iteration->getParameter('query'), 'JCR-SQL2');
2021
$query->execute();
@@ -27,7 +28,7 @@ public function benchQuery(BenchIteration $iteration)
2728
* @beforeMethod beforeCreateNodes
2829
* @iterations 1
2930
*/
30-
public function benchQueryAndIterate(BenchIteration $iteration)
31+
public function benchQueryAndIterate(Iteration $iteration)
3132
{
3233
$query = $this->getQueryManager()->createQuery($iteration->getParameter('query'), 'JCR-SQL2');
3334
$result = $query->execute();
@@ -44,7 +45,7 @@ public function benchQueryAndIterate(BenchIteration $iteration)
4445
* @beforeMethod beforeCreateNodes
4546
* @iterations 2
4647
*/
47-
public function benchQueryAndIterateWithNode(BenchIteration $iteration)
48+
public function benchQueryAndIterateWithNode(Iteration $iteration)
4849
{
4950
$query = $this->getQueryManager()->createQuery($iteration->getParameter('query'), 'JCR-SQL2');
5051
$result = $query->execute();
@@ -111,7 +112,7 @@ public function benchSearchPropertyFullText()
111112
}
112113
}
113114

114-
public function beforeCreateNodes(BenchIteration $iteration)
115+
public function beforeCreateNodes(Iteration $iteration)
115116
{
116117
// do not recreate nodes in the same iteration set
117118
if ($iteration->getIndex() > 0) {
@@ -134,7 +135,7 @@ public function beforeCreateNodes(BenchIteration $iteration)
134135
$this->getSession()->save();
135136
}
136137

137-
public function beforeAppendNode(BenchIteration $iteration)
138+
public function beforeAppendNode(Iteration $iteration)
138139
{
139140
// do not recreate nodes in the same iteration set
140141
if ($iteration->getIndex() > 0) {

0 commit comments

Comments
 (0)