Skip to content

Commit 2005929

Browse files
committed
fixing annotations and whitespace in tests
1 parent 66030c3 commit 2005929

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

inc/AbstractLoader.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
2+
23
namespace PHPCR\Test;
34

5+
use PHPCR\RepositoryFactoryInterface;
6+
47
/**
58
* Base class for the bootstrapping to load your phpcr implementation for the
69
* test suite.
@@ -72,22 +75,26 @@ public abstract function getRepositoryFactoryParameters();
7275
* The default implementation uses the factory, but if the factory has an
7376
* error, you will get failing tests all over.
7477
*
75-
* @return PHPCR\RepositoryInstance the repository instance
78+
* @return \PHPCR\RepositoryInterface the repository instance
7679
*/
7780
public function getRepository()
7881
{
7982
$factoryclass = $this->getRepositoryFactoryClass();
8083
$factory = new $factoryclass;
84+
if (! $factory instanceof RepositoryFactoryInterface) {
85+
throw new \Exception("$factoryclass is not of type RepositoryFactoryInterface");
86+
}
87+
/** @var $factory RepositoryFactoryInterface */
8188
return $factory->getRepository($this->getRepositoryFactoryParameters());
8289
}
8390

8491
/**
85-
* @return PHPCR\CredentialsInterface the login credentials that lead to successful login into the repository
92+
* @return \PHPCR\CredentialsInterface the login credentials that lead to successful login into the repository
8693
*/
8794
public abstract function getCredentials();
8895

8996
/**
90-
* @return PHPCR\CredentialsInterface the login credentials that lead to login failure
97+
* @return \PHPCR\CredentialsInterface the login credentials that lead to login failure
9198
*/
9299
public abstract function getInvalidCredentials();
93100

@@ -97,7 +104,7 @@ public abstract function getInvalidCredentials();
97104
*
98105
* The user may not have write access to /tests_general_base/numberPropertyNode/jcr:content/foo
99106
*
100-
* @return PHPCR\CredentialsInterface the login credentials with limited permissions for testing impersonate and access control
107+
* @return \PHPCR\CredentialsInterface the login credentials with limited permissions for testing impersonate and access control
101108
*/
102109
public abstract function getRestrictedCredentials();
103110

@@ -118,7 +125,7 @@ public function getWorkspaceName()
118125
* Get a session for this implementation.
119126
*
120127
* @param \PHPCR\CredentialsInterface $credentials The credentials to log into the repository. If omitted, self::getCredentials should be used
121-
* @return PHPCR\SessionInterface the session resulting from logging into the repository with the provided credentials
128+
* @return \PHPCR\SessionInterface the session resulting from logging into the repository with the provided credentials
122129
*/
123130
public function getSession($credentials = false)
124131
{
@@ -151,7 +158,7 @@ public function getTestSupported($chapter, $case, $name)
151158
}
152159

153160
/**
154-
* @return PHPCR\Test\FixtureLoaderInterface implementation that is used to load test fixtures
161+
* @return \PHPCR\Test\FixtureLoaderInterface implementation that is used to load test fixtures
155162
*/
156163
public abstract function getFixtureLoader();
157164

tests/23_OrderableChildNodes/OrderBeforeTest.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ public function testNodeOrderBeforeUpAndDelete()
212212
*/
213213
public function testNodeOrderBeforeUpAndRefresh()
214214
{
215+
/** @var $session \PHPCR\SessionInterface */
215216
$session = $this->sharedFixture['session'];
216217
$this->assertInstanceOf('\PHPCR\NodeInterface', $this->node);
217218
$path = $this->node->getPath();
@@ -389,6 +390,7 @@ public function testNodeOrderNamespaces()
389390
*/
390391
public function testNodeOrderAfterOrderAndMove()
391392
{
393+
/** @var $session \PHPCR\SessionInterface */
392394
$session = $this->sharedFixture['session'];
393395
$this->assertInstanceOf('\PHPCR\NodeInterface', $this->node);
394396

@@ -400,15 +402,15 @@ public function testNodeOrderAfterOrderAndMove()
400402

401403
$srcParentNode->orderBefore('three', 'two');
402404
$dstParentNode->orderBefore('three', 'two');
403-
405+
404406
$session->move($src . '/three', $dst . '/moved-three');
405-
$dstNode = $session->getNode($dst . '/moved-three');
407+
$dstNode = $session->getNode($dst . '/moved-three');
406408
$this->assertInstanceOf('PHPCR\NodeInterface', $dstNode);
407-
408-
$dstParentNode = $session->getNode($dst);
409+
410+
$dstParentNode = $session->getNode($dst);
409411
$this->assertChildOrder(array('one', 'three', 'two', 'four', 'moved-three'), $dstParentNode);
410412

411-
$srcParentNode = $session->getNode($src);
413+
$srcParentNode = $session->getNode($src);
412414
$this->assertChildOrder(array('one', 'two', 'four'), $srcParentNode);
413415

414416
$session->save();
@@ -418,10 +420,10 @@ public function testNodeOrderAfterOrderAndMove()
418420
$dstNode = $session->getNode($dst . '/moved-three');
419421
$this->assertInstanceOf('PHPCR\NodeInterface', $dstNode);
420422

421-
$dstParentNode = $session->getNode($dst);
423+
$dstParentNode = $session->getNode($dst);
422424
$this->assertChildOrder(array('one', 'three', 'two', 'four', 'moved-three'), $dstParentNode);
423425

424-
$srcParentNode = $session->getNode($src);
426+
$srcParentNode = $session->getNode($src);
425427
$this->assertChildOrder(array('one', 'two', 'four'), $srcParentNode);
426428
}
427429
}

0 commit comments

Comments
 (0)