Skip to content

Commit a4baec7

Browse files
committed
cs fixes
1 parent dcb1cc6 commit a4baec7

File tree

59 files changed

+116
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+116
-149
lines changed

inc/FixtureLoaderInterface.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ interface FixtureLoaderInterface
1515
*
1616
* Default fixtures in the jcr system view format live folder fixtures/
1717
*
18-
* @param string $fixture the fixtures "name", i.e. "general/base"
18+
* @param string $fixture the fixtures "name", i.e. "general/base"
1919
* @param string $workspaceKey the config key for the target workspace, optional
20-
*
21-
* @return void
2220
*/
2321
public function import($fixture, $workspaceKey = 'workspace');
2422
}

tests/04_Connecting/SimpleCredentialsTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ protected function assertSimpleCredentials($user, $password)
2222
{
2323
$cr = new \PHPCR\SimpleCredentials($user, $password);
2424
$this->assertInstanceOf('PHPCR\CredentialsInterface', $cr);
25+
2526
return $cr;
2627
}
2728

tests/04_Connecting/WorkspaceReadMethodsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class WorkspaceReadMethodsTest extends \PHPCR\Test\BaseCase
1717

1818
//4.5 Workspace Read Methods
1919

20-
function setUp()
20+
public function setUp()
2121
{
2222
parent::setUp();
2323
$this->workspace = $this->sharedFixture['session']->getWorkspace();

tests/05_Reading/EncodingTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class EncodingTest extends \PHPCR\Test\BaseCase
1111
{
1212

13-
static public function setupBeforeClass($fixtures = '05_Reading/encoding')
13+
public static function setupBeforeClass($fixtures = '05_Reading/encoding')
1414
{
1515
parent::setupBeforeClass($fixtures);
1616
}

tests/05_Reading/NodeReadMethodsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function testGetNodes()
155155
$this->assertInstanceOf('Countable', $iterator);
156156

157157
$this->assertCount(8, $iterator);
158-
foreach($iterator as $node) {
158+
foreach ($iterator as $node) {
159159
$this->assertInstanceOf('PHPCR\NodeInterface', $node);
160160
}
161161
}
@@ -245,7 +245,7 @@ public function testGetNodeNames()
245245
$this->assertInstanceOf('Iterator', $iterator);
246246

247247
$names = array();
248-
foreach($iterator as $name) {
248+
foreach ($iterator as $name) {
249249
$names[] = $name;
250250
}
251251

tests/05_Reading/PropertyReadMethodsTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function setUp()
5555
}
5656

5757
/*** item base methods for property ***/
58-
function testGetAncestor()
58+
public function testGetAncestor()
5959
{
6060
$ancestor = $this->dateProperty->getAncestor(0);
6161
$this->assertNotNull($ancestor);
@@ -73,7 +73,7 @@ function testGetAncestor()
7373
$this->assertInstanceOf('PHPCR\PropertyInterface', $ancestor);
7474
$this->assertTrue($this->dateProperty->isSame($ancestor));
7575
}
76-
function testGetDepthProperty()
76+
public function testGetDepthProperty()
7777
{
7878
$this->assertEquals(2, $this->createdProperty->getDepth());
7979
$this->assertEquals(4, $this->dateProperty->getDepth());
@@ -115,7 +115,7 @@ public function testAccept()
115115
$this->createdProperty->accept($mock);
116116
}
117117

118-
function testGetPropertyName()
118+
public function testGetPropertyName()
119119
{
120120
$name = $this->createdProperty->getName();
121121
$this->assertEquals('jcr:created', $name);
@@ -452,7 +452,6 @@ public function testGetLength()
452452
$this->assertEquals(29, $this->dateProperty->getLength());
453453
}
454454

455-
456455
//binary length is tested in BinaryReadMethodsTest
457456

458457
// testGetLengthUnsuccessfull (return -1 on getLength) "should never happen" so no test

tests/05_Reading/SessionReadMethodsTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ public function testGetPropertiesInvalidArgument()
179179
$this->sharedFixture['session']->getProperties('no iterable thing');
180180
}
181181

182-
183182
/**
184183
* it is forbidden to call getItem on the session with a relative path
185184
* @expectedException \PHPCR\PathNotFoundException
@@ -227,7 +226,6 @@ public function testItemExistsInvalidPath()
227226
$this->sharedFixture['session']->itemExists('//');
228227
}
229228

230-
231229
public function testNodeExists()
232230
{
233231
$this->assertTrue($this->sharedFixture['session']->nodeExists('/'));

tests/06_Query/CharacterTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
require_once(__DIR__ . '/../../inc/BaseCase.php');
88

9-
109
class CharacterTest extends \PHPCR\Test\BaseCase
1110
{
1211
public static function setupBeforeClass($fixtures = '06_Query/characters')
@@ -113,4 +112,4 @@ public function testQueryWithColon()
113112
QueryInterface::JCR_SQL2
114113
)->execute();
115114
}
116-
}
115+
}

tests/06_Query/NodeViewTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace PHPCR\Tests\Query;
33

4-
require_once('QueryBaseCase.php');
4+
require_once 'QueryBaseCase.php';
55

66
/**
77
* test the query result node view $ 6.11.2

tests/06_Query/QOM/ConvertQueriesBackAndForthTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
namespace PHPCR\Tests\Query\QOM;
33

44
require_once(__DIR__ . '/../../../inc/BaseCase.php');
5-
require_once('Sql2TestQueries.php');
6-
require_once('QomTestQueries.php');
5+
require_once 'Sql2TestQueries.php';
6+
require_once 'QomTestQueries.php';
77

88
use PHPCR\Util\QOM\Sql2Generator;
99
use PHPCR\Util\QOM\Sql2ToQomQueryConverter;
@@ -43,7 +43,7 @@ public function setUp()
4343

4444
try {
4545
$this->sql2Parser = new Sql2ToQomQueryConverter($factory);
46-
} catch(\PHPCR\UnsupportedRepositoryOperationException $e) {
46+
} catch (\PHPCR\UnsupportedRepositoryOperationException $e) {
4747
$this->markTestSkipped('Repository does not support the QOM factory');
4848
}
4949
}

tests/06_Query/QOM/QomTestQueries.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
* The QOM queries defined here correspond to the SQL2 queries defined in Sql2TestQueries.
1010
* @see Sql2TestQueries
1111
*/
12-
class QomTestQueries {
13-
14-
public static function getQueries(\PHPCR\Query\QOM\QueryObjectModelFactoryInterface $factory) {
15-
12+
class QomTestQueries
13+
{
14+
public static function getQueries(\PHPCR\Query\QOM\QueryObjectModelFactoryInterface $factory)
15+
{
1616
$queries = array();
1717

1818
/**

tests/06_Query/QOM/QomToSql2ConverterTest.php

+7-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
namespace PHPCR\Tests\Query\QOM;
33

44
require_once(__DIR__ . '/../../../inc/BaseCase.php');
5-
require_once('Sql2TestQueries.php');
5+
require_once 'Sql2TestQueries.php';
66

77
use Jackalope\Query\QOM; // TODO get rid of jackalope dependency
88
use PHPCR\Util\QOM\QomToSql2QueryConverter;
@@ -38,7 +38,7 @@ public function setUp()
3838
$this->parser = new QomToSql2QueryConverter(new Sql2Generator(new ValueConverter()));
3939
try {
4040
$this->factory = $this->sharedFixture['session']->getWorkspace()->getQueryManager()->getQOMFactory();
41-
} catch(\PHPCR\UnsupportedRepositoryException $e) {
41+
} catch (\PHPCR\UnsupportedRepositoryException $e) {
4242
$this->markTestSkipped('Repository does not support the QOM factory');
4343
}
4444
$this->queries = Sql2TestQueries::getQueries();
@@ -364,7 +364,6 @@ public function testBindVariable()
364364
$this->assertQuery($this->queries['6.7.35.BindValue'], $selector, array(), $constraint, array());
365365
}
366366

367-
368367
/**
369368
* 6.7.38 Order
370369
*/
@@ -395,18 +394,17 @@ public function testColumns()
395394
$this->assertQuery($this->queries['6.7.39.Colum.Mixed'], $selector, array($col1, $col2, $col3));
396395
}
397396

398-
399397
// -------------------------------------------------------------------------
400398

401399
/**
402400
* Assert that a QOM query specified by its source, columns, constraint and orderings
403401
* will be converted in the expected SQL2 query.
404402
*
405-
* @param string $expectedSql2 The expected SQL2 query
406-
* @param \PHPCR\Query\QOM\SourceInterface $source The source of the QOM query
407-
* @param array $columns The columns of the QOM query
408-
* @param \PHPCR\Query\QOM\ContraintInterface $constraint The contraint of the QOM query
409-
* @param array $ordering The orderings of the QOM query
403+
* @param string $expectedSql2 The expected SQL2 query
404+
* @param \PHPCR\Query\QOM\SourceInterface $source The source of the QOM query
405+
* @param array $columns The columns of the QOM query
406+
* @param \PHPCR\Query\QOM\ContraintInterface $constraint The contraint of the QOM query
407+
* @param array $ordering The orderings of the QOM query
410408
*/
411409
protected function assertQuery($expectedSql2, $source, $columns = array(), $constraint = null, $ordering = array())
412410
{

tests/06_Query/QOM/Sql2TestQueries.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
* The SQL2 queries defined here correspond to the QOM queries defined in QomTestQueries.
88
* @see QomTestQueries
99
*/
10-
class Sql2TestQueries {
11-
12-
public static function getQueries() {
13-
10+
class Sql2TestQueries
11+
{
12+
public static function getQueries()
13+
{
1414
$queries = array();
1515

1616
/**
@@ -199,7 +199,6 @@ public static function getQueries() {
199199
*/
200200
$queries['6.7.35.BindValue'] = 'SELECT * FROM [nt:file] WHERE UPPER(NAME()) LIKE $var';
201201

202-
203202
/**
204203
* 6.7.38 Order
205204
*/

tests/06_Query/QOM/Sql2ToQomConverterTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
namespace PHPCR\Tests\Query\QOM;
33

44
require_once(__DIR__ . '/../../../inc/BaseCase.php');
5-
require_once('Sql2TestQueries.php');
6-
require_once('QomTestQueries.php');
5+
require_once 'Sql2TestQueries.php';
6+
require_once 'QomTestQueries.php';
77

8-
use PHPCR\Util\QOM\Sql2Scanner;
98
use PHPCR\Util\QOM\Sql2ToQomQueryConverter;
109

1110
class Sql2ToQomConverterTest extends \PHPCR\Test\BaseCase
@@ -27,7 +26,7 @@ public function setUp()
2726

2827
try {
2928
$this->parser = new Sql2ToQomQueryConverter($factory);
30-
} catch(\PHPCR\UnsupportedRepositoryException $e) {
29+
} catch (\PHPCR\UnsupportedRepositoryException $e) {
3130
$this->markTestSkipped('Repository does not support the QOM factory');
3231
}
3332
}

tests/06_Query/QueryManagerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace PHPCR\Tests\Query;
33

4-
require_once('QueryBaseCase.php');
4+
require_once 'QueryBaseCase.php';
55

66
/**
77
* tests for the query manager, $ 6.8

tests/06_Query/QueryObjectQOMTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace PHPCR\Tests\Query;
33

4-
require_once('QueryBaseCase.php');
4+
require_once 'QueryBaseCase.php';
55

66
/**
77
* test the Query Factory integration

tests/06_Query/QueryObjectSql2Test.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace PHPCR\Tests\Query;
33

4-
require_once('QueryBaseCase.php');
4+
require_once 'QueryBaseCase.php';
55

66
/**
77
* test the Query interface. $ 6.9
@@ -115,7 +115,7 @@ public function testGetStoredQueryPath()
115115

116116
$p = $query->getStoredQueryPath();
117117
$this->assertEquals('/tests_general_query/queryNode', $p);
118-
} catch(\Exception $e) {
118+
} catch (\Exception $e) {
119119
//FIXME: finally?
120120
$this->sharedFixture['ie']->import('general/base');
121121
throw $e;

tests/06_Query/QueryResultsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use PHPCR\Query\QueryResultInterface;
55

6-
require_once('QueryBaseCase.php');
6+
require_once 'QueryBaseCase.php';
77

88
/**
99
* $ 6.11 QueryResult - Test the query result object

tests/06_Query/QuerySql2OperationsTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use PHPCR\Query\QueryInterface;
55

6-
require_once('QueryBaseCase.php');
6+
require_once 'QueryBaseCase.php';
77

88
/**
99
* Run non-trivial queries to try out where, the join features and such
@@ -130,7 +130,7 @@ public function testQueryJoin()
130130
$this->assertInstanceOf('\PHPCR\Query\QueryResultInterface', $result);
131131
$vals = array();
132132

133-
foreach($result->getRows() as $row) {
133+
foreach ($result->getRows() as $row) {
134134
$vals[] = $row->getValue('nt:unstructured.longNumber');
135135
}
136136
$this->assertEquals(array(999), $vals);
@@ -155,7 +155,7 @@ public function testQueryJoinWithAlias()
155155
$this->assertInstanceOf('\PHPCR\Query\QueryResultInterface', $result);
156156
$vals = array();
157157

158-
foreach($result->getRows() as $row) {
158+
foreach ($result->getRows() as $row) {
159159
$vals[] = $row->getValue('content.longNumber');
160160
}
161161
$this->assertEquals(array(999), $vals);

tests/06_Query/RowIteratorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace PHPCR\Tests\Query;
33

4-
require_once('QueryBaseCase.php');
4+
require_once 'QueryBaseCase.php';
55

66
/**
77
* $ 6.11.1 Row View - Iterator part

tests/06_Query/RowTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace PHPCR\Tests\Query;
33

4-
require_once('QueryBaseCase.php');
4+
require_once 'QueryBaseCase.php';
55

66
/**
77
* $ 6.11.1 Table View - Row part

tests/06_Query/Sql1/QueryBaseCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ public function setUp()
1818

1919
$this->query = $this->sharedFixture['qm']->createQuery("SELECT * FROM nt:folder", \PHPCR\Query\QueryInterface::JCR_SQL2);
2020
}
21-
21+
2222
}

tests/06_Query/Sql1/QueryOperationsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use PHPCR\Query\QueryInterface;
55

6-
require_once('QueryBaseCase.php');
6+
require_once 'QueryBaseCase.php';
77

88
/**
99
* Run non-trivial queries to try out where, the join features and such

tests/06_Query/XPath/QueryOperationsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use PHPCR\Query\QueryInterface;
55

6-
require_once('QueryBaseCase.php');
6+
require_once 'QueryBaseCase.php';
77

88
/**
99
* Run non-trivial queries to try out where, the join features and such

0 commit comments

Comments
 (0)