Skip to content

Commit 42db960

Browse files
committed
Merge pull request #158 from phpcr/cleanup-tests
fix some tests to not be risky anymore and cleanup phpdoc
2 parents f93cccd + ff94e82 commit 42db960

File tree

7 files changed

+33
-8
lines changed

7 files changed

+33
-8
lines changed

src/PHPCR/Util/NodeHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ public static function purgeWorkspace(SessionInterface $session)
8989
/**
9090
* Kept as alias of purgeWorkspace for BC compatibility
9191
*
92+
* @param SessionInterface $session
93+
*
9294
* @deprecated
9395
*/
9496
public static function deleteAllNodes(SessionInterface $session)
@@ -102,6 +104,8 @@ public static function deleteAllNodes(SessionInterface $session)
102104
* repository.
103105
*
104106
* @param ItemInterface $item
107+
*
108+
* @return boolean true if $item is a system item, false otherwise
105109
*/
106110
public static function isSystemItem(ItemInterface $item)
107111
{

src/PHPCR/Util/QOM/QueryBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ public function getSource()
417417
*
418418
* @return QueryBuilder This QueryBuilder instance.
419419
*
420-
* @throws RuntimeException if there is not an existing source.
420+
* @throws \RuntimeException if there is not an existing source.
421421
*/
422422
public function join(SourceInterface $rightSource, JoinConditionInterface $joinCondition)
423423
{
@@ -432,7 +432,7 @@ public function join(SourceInterface $rightSource, JoinConditionInterface $joinC
432432
*
433433
* @return QueryBuilder This QueryBuilder instance.
434434
*
435-
* @throws RuntimeException if there is not an existing source.
435+
* @throws \RuntimeException if there is not an existing source.
436436
*/
437437
public function innerJoin(SourceInterface $rightSource, JoinConditionInterface $joinCondition)
438438
{
@@ -447,7 +447,7 @@ public function innerJoin(SourceInterface $rightSource, JoinConditionInterface $
447447
*
448448
* @return QueryBuilder This QueryBuilder instance.
449449
*
450-
* @throws RuntimeException if there is not an existing source.
450+
* @throws \RuntimeException if there is not an existing source.
451451
*/
452452
public function leftJoin(SourceInterface $rightSource, JoinConditionInterface $joinCondition)
453453
{
@@ -462,7 +462,7 @@ public function leftJoin(SourceInterface $rightSource, JoinConditionInterface $j
462462
*
463463
* @return QueryBuilder This QueryBuilder instance.
464464
*
465-
* @throws RuntimeException if there is not an existing source.
465+
* @throws \RuntimeException if there is not an existing source.
466466
*/
467467
public function rightJoin(SourceInterface $rightSource, JoinConditionInterface $joinCondition)
468468
{
@@ -478,7 +478,7 @@ public function rightJoin(SourceInterface $rightSource, JoinConditionInterface $
478478
*
479479
* @return QueryBuilder This QueryBuilder instance.
480480
*
481-
* @throws RuntimeException if there is not an existing source.
481+
* @throws \RuntimeException if there is not an existing source.
482482
*/
483483
public function joinWithType(SourceInterface $rightSource, $joinType, JoinConditionInterface $joinCondition)
484484
{

src/PHPCR/Util/QOM/Sql1Generator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ protected function getPathForDescendantQuery($path)
5050
*
5151
* @param string $path
5252
* @param string $selectorName
53+
*
54+
* @return string
5355
*/
5456
public function evalChildNode($path, $selectorName = null)
5557
{
@@ -142,6 +144,8 @@ public function evalColumns($columns)
142144
*
143145
* @param string $propertyName
144146
* @param string $selectorName unused in SQL1
147+
*
148+
* @return string
145149
*/
146150
public function evalPropertyValue($propertyName, $selectorName = null)
147151
{

src/PHPCR/Util/QOM/Sql2Generator.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ public function evalDescendantNodeJoinCondition($descendantSelectorName, $ancest
166166
*
167167
* @param string $path
168168
* @param string $selectorName
169+
*
170+
* @return string
169171
*/
170172
public function evalSameNode($path, $selectorName = null)
171173
{
@@ -181,6 +183,8 @@ public function evalSameNode($path, $selectorName = null)
181183
*
182184
* @param string $path
183185
* @param string $selectorName
186+
*
187+
* @return string
184188
*/
185189
public function evalChildNode($path, $selectorName = null)
186190
{
@@ -196,6 +200,8 @@ public function evalChildNode($path, $selectorName = null)
196200
*
197201
* @param string $path
198202
* @param string $selectorName
203+
*
204+
* @return string
199205
*/
200206
public function evalDescendantNode($path, $selectorName = null)
201207
{
@@ -260,6 +266,8 @@ public function evalLength($propertyValue)
260266
* NodeName ::= 'NAME(' [selectorName] ')'
261267
*
262268
* @param string $selectorValue
269+
*
270+
* @return string
263271
*/
264272
public function evalNodeName($selectorValue = null)
265273
{
@@ -270,6 +278,8 @@ public function evalNodeName($selectorValue = null)
270278
* NodeLocalName ::= 'LOCALNAME(' [selectorName] ')'
271279
*
272280
* @param string $selectorValue
281+
*
282+
* @return string
273283
*/
274284
public function evalNodeLocalName($selectorValue = null)
275285
{
@@ -280,6 +290,8 @@ public function evalNodeLocalName($selectorValue = null)
280290
* FullTextSearchScore ::= 'SCORE(' [selectorName] ')'
281291
*
282292
* @param string $selectorValue
293+
*
294+
* @return string
283295
*/
284296
public function evalFullTextSearchScore($selectorValue = null)
285297
{
@@ -291,6 +303,8 @@ public function evalFullTextSearchScore($selectorValue = null)
291303
*
292304
* @param string $propertyName
293305
* @param string $selectorName
306+
*
307+
* @return string
294308
*/
295309
public function evalPropertyValue($propertyName, $selectorName = null)
296310
{

src/PHPCR/Util/TreeWalker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ class TreeWalker
3333
/**
3434
* Filters to apply to decide whether a node needs to be visited
3535
*
36-
* @var array()
36+
* @var TreeWalkerFilterInterface[]
3737
*/
3838
protected $nodeFilters = array();
3939

4040
/**
4141
* Filters to apply to decide whether a property needs to be visited
4242
*
43-
* @var array()
43+
* @var TreeWalkerFilterInterface[]
4444
*/
4545
protected $propertyFilters = array();
4646

tests/PHPCR/Tests/Util/PathHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testAssertInvalidAbsolutePath($path, $destination = false)
4242
*/
4343
public function testAssertAbsolutePathNamespace($path)
4444
{
45-
PathHelper::assertValidAbsolutePath($path, false, true, array('jcr', 'nt'));
45+
$this->assertTrue(PathHelper::assertValidAbsolutePath($path, false, true, array('jcr', 'nt')));
4646
}
4747

4848
public function dataproviderValidAbsolutePathsWithNamespaces()

tests/PHPCR/Tests/Util/QOM/QueryBuilderTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ public function testJoin()
174174
$source1 = $this->getMock('PHPCR\Query\QOM\SourceInterface', array(), array());
175175
$source2= $this->getMock('PHPCR\Query\QOM\SourceInterface', array(), array());
176176
$joinCondition = $this->getMock('PHPCR\Query\QOM\SameNodeJoinConditionInterface', array(), array());
177+
$this->qf->expects($this->once())
178+
->method('join')
179+
->with($source1, $source2, $this->equalTo(\PHPCR\Query\QOM\QueryObjectModelConstantsInterface::JCR_JOIN_TYPE_INNER), $joinCondition);
177180
$qb = new QueryBuilder($this->qf);
178181
$qb->from($source1);
179182
$qb->join($source2, $joinCondition);

0 commit comments

Comments
 (0)