From c8c32ce6eef7c3ac4a7b7f5c77d54c8c4f14621b Mon Sep 17 00:00:00 2001 From: dantleech Date: Sat, 27 Jun 2015 17:01:53 +0200 Subject: [PATCH 1/7] Added autoloading --- composer.json | 6 ++++++ inc/autoload.php | 9 --------- {inc => lib}/AbstractLoader.php | 0 {inc => lib}/BaseCase.php | 0 {inc => lib}/FixtureLoaderInterface.php | 0 5 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 inc/autoload.php rename {inc => lib}/AbstractLoader.php (100%) rename {inc => lib}/BaseCase.php (100%) rename {inc => lib}/FixtureLoaderInterface.php (100%) diff --git a/composer.json b/composer.json index 6bef04f1..01304001 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,12 @@ "php": ">=5.3.0", "phpcr/phpcr-implementation": "2.1.*" }, + "autoload": { + "psr-4": { + "PHPCR\\Test\\": "lib", + "PHPCR\\Tests\\": "tests" + } + }, "extra": { "branch-alias": { "dev-master": "2.1-dev" diff --git a/inc/autoload.php b/inc/autoload.php deleted file mode 100644 index f5dba3ed..00000000 --- a/inc/autoload.php +++ /dev/null @@ -1,9 +0,0 @@ -importXML - */ -return array( - 'jackrabbit_importexport' => __DIR__.'/importexport.php', -); diff --git a/inc/AbstractLoader.php b/lib/AbstractLoader.php similarity index 100% rename from inc/AbstractLoader.php rename to lib/AbstractLoader.php diff --git a/inc/BaseCase.php b/lib/BaseCase.php similarity index 100% rename from inc/BaseCase.php rename to lib/BaseCase.php diff --git a/inc/FixtureLoaderInterface.php b/lib/FixtureLoaderInterface.php similarity index 100% rename from inc/FixtureLoaderInterface.php rename to lib/FixtureLoaderInterface.php From 7f8ef45e7921c93a1e33dc38f8bea2a6fcf9f873 Mon Sep 17 00:00:00 2001 From: dantleech Date: Sat, 27 Jun 2015 17:20:42 +0200 Subject: [PATCH 2/7] Removed requires --- tests/04_Connecting/RepositoryDescriptorsTest.php | 1 - tests/04_Connecting/RepositoryFactoryTest.php | 1 - tests/04_Connecting/RepositoryTest.php | 1 - tests/04_Connecting/SessionReadMethodsTest.php | 1 - tests/04_Connecting/SimpleCredentialsTest.php | 1 - tests/04_Connecting/WorkspaceReadMethodsTest.php | 1 - tests/05_Reading/BinaryReadMethodsTest.php | 1 - tests/05_Reading/EncodingTest.php | 1 - tests/05_Reading/JackalopeFetchDepthTest.php | 1 - tests/05_Reading/NodeReadMethodsTest.php | 1 - tests/05_Reading/PropertyReadMethodsTest.php | 1 - tests/05_Reading/SessionNamespaceRemappingTest.php | 1 - tests/05_Reading/SessionReadMethodsTest.php | 1 - tests/06_Query/CharacterTest.php | 1 - tests/06_Query/NodeViewTest.php | 1 - tests/06_Query/QOM/ConvertQueriesBackAndForthTest.php | 3 --- tests/06_Query/QOM/QomToSql2ConverterTest.php | 2 -- tests/06_Query/QOM/Sql2ScannerTest.php | 1 - tests/06_Query/QOM/Sql2ToQomConverterTest.php | 3 --- tests/06_Query/QueryBaseCase.php | 1 - tests/06_Query/QueryManagerTest.php | 1 - tests/06_Query/QueryObjectQOMTest.php | 1 - tests/06_Query/QueryObjectSql2Test.php | 1 - tests/06_Query/QueryResultsTest.php | 1 - tests/06_Query/QuerySql2OperationsTest.php | 1 - tests/06_Query/RowIteratorTest.php | 1 - tests/06_Query/RowTest.php | 1 - tests/06_Query/Sql1/QueryBaseCase.php | 2 -- tests/06_Query/Sql1/QueryOperationsTest.php | 1 - tests/06_Query/XPath/QueryBaseCase.php | 2 -- tests/06_Query/XPath/QueryOperationsTest.php | 1 - tests/07_Export/ExportRepositoryContentTest.php | 1 - tests/08_NodeTypeDiscovery/NodeDefinitionTest.php | 1 - tests/08_NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php | 1 - tests/08_NodeTypeDiscovery/NodeTypeDiscoveryTest.php | 1 - tests/08_NodeTypeDiscovery/NodeTypeTest.php | 1 - tests/08_NodeTypeDiscovery/PropertyDefinitionTest.php | 1 - tests/09_PermissionsAndCapabilities/PermissionReadTest.php | 1 - tests/10_Writing/AddMethodsTest.php | 1 - tests/10_Writing/CloneMethodsTest.php | 1 - tests/10_Writing/CombinedManipulationsTest.php | 1 - tests/10_Writing/CopyMethodsTest.php | 1 - tests/10_Writing/DeleteMethodsTest.php | 1 - tests/10_Writing/EncodingTest.php | 1 - tests/10_Writing/ItemStateTest.php | 1 - tests/10_Writing/LastModifiedTest.php | 1 - tests/10_Writing/LastModifiedUpdateTest.php | 1 - tests/10_Writing/MixinCreatedTest.php | 1 - tests/10_Writing/MixinReferenceableTest.php | 1 - tests/10_Writing/MoveMethodsTest.php | 1 - tests/10_Writing/NamespaceRegistryTest.php | 1 - tests/10_Writing/NodeTypeAssignementTest.php | 1 - tests/10_Writing/NodeTypePreemptiveValidationTest.php | 1 - tests/10_Writing/SetPropertyDynamicRebindingTest.php | 1 - tests/10_Writing/SetPropertyMethodsTest.php | 1 - tests/10_Writing/SetPropertyTypesTest.php | 1 - tests/11_Import/ImportRepositoryContentTest.php | 1 - tests/12_Observation/ObservationManagerTest.php | 1 - tests/13_WorkspaceManagement/WorkspaceManagementTest.php | 1 - tests/15_Versioning/CreateVersionableNodeTest.php | 1 - tests/15_Versioning/NodeTypeReadTest.php | 1 - tests/15_Versioning/SimpleVersionTest.php | 1 - tests/15_Versioning/VersionHistoryTest.php | 1 - tests/15_Versioning/VersionManagerTest.php | 1 - tests/15_Versioning/VersionTest.php | 1 - tests/17_Locking/LockManagerTest.php | 1 - tests/19_NodeTypeManagement/CndTest.php | 1 - tests/19_NodeTypeManagement/NodeTypeBaseCase.php | 1 - tests/19_NodeTypeManagement/NodeTypeTest.php | 1 - tests/21_Transactions/TransactionMethodsTest.php | 1 - tests/22_SameNameSiblings/DeleteMethodsTest.php | 1 - tests/23_OrderableChildNodes/OrderBeforeTest.php | 1 - tests/PhpcrUtils/CndParserTest.php | 1 - tests/PhpcrUtils/CndWriterTest.php | 1 - tests/PhpcrUtils/PurgeTest.php | 1 - 75 files changed, 82 deletions(-) diff --git a/tests/04_Connecting/RepositoryDescriptorsTest.php b/tests/04_Connecting/RepositoryDescriptorsTest.php index af59d56f..c0f516e7 100644 --- a/tests/04_Connecting/RepositoryDescriptorsTest.php +++ b/tests/04_Connecting/RepositoryDescriptorsTest.php @@ -1,7 +1,6 @@ Date: Sat, 27 Jun 2015 17:23:11 +0200 Subject: [PATCH 3/7] Applied CS fixer --- .php_cs | 30 ++++++ bootstrap.dist.php | 18 +++- fixtures/06_Query/characters.xml | 2 +- fixtures/10_Writing/mixinreferenceable.xml | 1 - fixtures/11_Import/simple.xml | 2 +- fixtures/general/query.xml | 2 +- lib/AbstractLoader.php | 49 +++++---- lib/BaseCase.php | 49 +++++---- lib/FixtureLoaderInterface.php | 14 ++- .../RepositoryDescriptorsTest.php | 11 ++- tests/04_Connecting/RepositoryFactoryTest.php | 14 ++- tests/04_Connecting/RepositoryTest.php | 21 ++-- .../04_Connecting/SessionReadMethodsTest.php | 18 +++- tests/04_Connecting/SimpleCredentialsTest.php | 13 ++- .../WorkspaceReadMethodsTest.php | 13 ++- tests/05_Reading/BinaryReadMethodsTest.php | 13 ++- tests/05_Reading/EncodingTest.php | 34 ++++--- tests/05_Reading/JackalopeFetchDepthTest.php | 16 ++- tests/05_Reading/NodeReadMethodsTest.php | 52 ++++++---- tests/05_Reading/PropertyReadMethodsTest.php | 40 +++++--- .../SessionNamespaceRemappingTest.php | 13 ++- tests/05_Reading/SessionReadMethodsTest.php | 29 ++++-- tests/06_Query/CharacterTest.php | 18 +++- tests/06_Query/NodeViewTest.php | 13 ++- .../QOM/ConvertQueriesBackAndForthTest.php | 11 ++- tests/06_Query/QOM/QomTestQueries.php | 72 ++++++++------ tests/06_Query/QOM/QomToSql2ConverterTest.php | 74 +++++++------- tests/06_Query/QOM/Sql2ScannerTest.php | 15 ++- tests/06_Query/QOM/Sql2TestQueries.php | 67 +++++++------ tests/06_Query/QOM/Sql2ToQomConverterTest.php | 11 ++- tests/06_Query/QueryBaseCase.php | 33 ++++--- tests/06_Query/QueryManagerTest.php | 13 ++- tests/06_Query/QueryObjectQOMTest.php | 27 +++-- tests/06_Query/QueryObjectSql2Test.php | 16 ++- tests/06_Query/QueryResultsTest.php | 28 ++++-- tests/06_Query/QuerySql2OperationsTest.php | 14 ++- tests/06_Query/RowIteratorTest.php | 13 ++- tests/06_Query/RowTest.php | 14 ++- tests/06_Query/Sql1/QueryBaseCase.php | 18 +++- tests/06_Query/Sql1/QueryOperationsTest.php | 14 ++- tests/06_Query/XPath/QueryBaseCase.php | 18 +++- tests/06_Query/XPath/QueryOperationsTest.php | 14 ++- .../07_Export/ExportRepositoryContentTest.php | 49 +++++---- .../NodeDefinitionTest.php | 20 ++-- .../NodeNodeTypeReadMethodsTest.php | 13 ++- .../NodeTypeDiscoveryTest.php | 25 +++-- tests/08_NodeTypeDiscovery/NodeTypeTest.php | 17 +++- .../PropertyDefinitionTest.php | 19 +++- .../PermissionReadTest.php | 13 ++- tests/10_Writing/AddMethodsTest.php | 38 ++++--- tests/10_Writing/CloneMethodsTest.php | 33 ++++--- .../10_Writing/CombinedManipulationsTest.php | 71 +++++++------ tests/10_Writing/CopyMethodsTest.php | 21 ++-- tests/10_Writing/DeleteMethodsTest.php | 99 +++++++++++-------- tests/10_Writing/EncodingTest.php | 29 ++++-- tests/10_Writing/ItemStateTest.php | 15 ++- tests/10_Writing/LastModifiedTest.php | 12 ++- tests/10_Writing/LastModifiedUpdateTest.php | 12 ++- tests/10_Writing/MixinCreatedTest.php | 21 ++-- tests/10_Writing/MixinReferenceableTest.php | 22 +++-- tests/10_Writing/MoveMethodsTest.php | 54 +++++----- tests/10_Writing/NamespaceRegistryTest.php | 16 ++- tests/10_Writing/NodeTypeAssignementTest.php | 24 +++-- .../NodeTypePreemptiveValidationTest.php | 18 +++- .../SetPropertyDynamicRebindingTest.php | 13 ++- tests/10_Writing/SetPropertyMethodsTest.php | 37 ++++--- tests/10_Writing/SetPropertyTypesTest.php | 14 ++- .../11_Import/ImportRepositoryContentTest.php | 49 +++++---- .../12_Observation/ObservationManagerTest.php | 35 ++++--- .../WorkspaceManagementTest.php | 11 ++- .../CreateVersionableNodeTest.php | 15 ++- tests/15_Versioning/NodeTypeReadTest.php | 11 ++- tests/15_Versioning/SimpleVersionTest.php | 17 +++- tests/15_Versioning/VersionHistoryTest.php | 24 +++-- tests/15_Versioning/VersionManagerTest.php | 15 ++- tests/15_Versioning/VersionTest.php | 17 +++- tests/17_Locking/LockManagerTest.php | 80 +++++++++------ tests/19_NodeTypeManagement/CndTest.php | 13 ++- .../NodeTypeBaseCase.php | 26 +++-- tests/19_NodeTypeManagement/NodeTypeTest.php | 13 ++- .../TransactionMethodsTest.php | 28 +++--- .../22_SameNameSiblings/DeleteMethodsTest.php | 16 ++- .../OrderBeforeTest.php | 52 ++++++---- tests/PhpcrUtils/CndParserTest.php | 17 ++-- tests/PhpcrUtils/CndWriterTest.php | 18 +++- tests/PhpcrUtils/PurgeTest.php | 13 ++- 86 files changed, 1446 insertions(+), 686 deletions(-) create mode 100644 .php_cs diff --git a/.php_cs b/.php_cs new file mode 100644 index 00000000..c7c12d3e --- /dev/null +++ b/.php_cs @@ -0,0 +1,30 @@ +fixers(array( + 'header_comment', + '-psr0', + 'psr4', + 'symfony', + 'concat_with_spaces', + 'concat_without_spaces', + '-phpdoc_indent', + '-phpdoc_params', + )) + ->finder( + Symfony\CS\Finder\DefaultFinder::create() + ->exclude('vendor') + ->in(__DIR__) + ) +; diff --git a/bootstrap.dist.php b/bootstrap.dist.php index 9cc2b103..6a32ebc1 100644 --- a/bootstrap.dist.php +++ b/bootstrap.dist.php @@ -1,8 +1,18 @@ - \ No newline at end of file + diff --git a/fixtures/10_Writing/mixinreferenceable.xml b/fixtures/10_Writing/mixinreferenceable.xml index 58859230..b16ae34c 100644 --- a/fixtures/10_Writing/mixinreferenceable.xml +++ b/fixtures/10_Writing/mixinreferenceable.xml @@ -130,4 +130,3 @@ - diff --git a/fixtures/11_Import/simple.xml b/fixtures/11_Import/simple.xml index d867212a..54b7ddd4 100644 --- a/fixtures/11_Import/simple.xml +++ b/fixtures/11_Import/simple.xml @@ -8,4 +8,4 @@ - \ No newline at end of file + diff --git a/fixtures/general/query.xml b/fixtures/general/query.xml index 9784ebcd..a6e22565 100644 --- a/fixtures/general/query.xml +++ b/fixtures/general/query.xml @@ -24,4 +24,4 @@ SELECT * FROM [nt:file] WHERE [nt:file].[jcr:mimeType] = "text/plain" - \ No newline at end of file + diff --git a/lib/AbstractLoader.php b/lib/AbstractLoader.php index c26a6c56..17d8a5c1 100644 --- a/lib/AbstractLoader.php +++ b/lib/AbstractLoader.php @@ -1,5 +1,14 @@ getRepositoryFactoryClass(); - $factory = new $factoryclass; - if (! $factory instanceof RepositoryFactoryInterface) { + $factory = new $factoryclass(); + if (!$factory instanceof RepositoryFactoryInterface) { throw new \Exception("$factoryclass is not of type RepositoryFactoryInterface"); } - /** @var $factory RepositoryFactoryInterface */ + /* @var $factory RepositoryFactoryInterface */ return $factory->getRepository($this->getRepositoryFactoryParameters()); } /** * @return \PHPCR\CredentialsInterface the login credentials that lead to successful login into the repository */ - public abstract function getCredentials(); + abstract public function getCredentials(); /** * @return \PHPCR\CredentialsInterface the login credentials that lead to login failure */ - public abstract function getInvalidCredentials(); + abstract public function getInvalidCredentials(); /** * Used when impersonating another user in Reading\SessionReadMethodsTests::testImpersonate - * And for Reading\SessionReadMethodsTest::testCheckPermissionAccessControlException + * And for Reading\SessionReadMethodsTest::testCheckPermissionAccessControlException. * * The user may not have write access to /tests_general_base/numberPropertyNode/jcr:content/foo * * @return \PHPCR\CredentialsInterface the login credentials with limited permissions for testing impersonate and access control */ - public abstract function getRestrictedCredentials(); + abstract public function getRestrictedCredentials(); /** * @return string the user id that is used in the credentials */ - public abstract function getUserId(); - + abstract public function getUserId(); /** * Make the repository ready for login with null credentials, handling the @@ -126,9 +134,9 @@ public abstract function getUserId(); * If the implementation does not support this feature, it must return * false for this method, otherwise true. * - * @return boolean true if anonymous login is supposed to work + * @return bool true if anonymous login is supposed to work */ - public abstract function prepareAnonymousLogin(); + abstract public function prepareAnonymousLogin(); /** * @return string the workspace name used for the tests @@ -158,6 +166,7 @@ public function getOtherWorkspaceName() * Get a session for this implementation. * * @param \PHPCR\CredentialsInterface $credentials The credentials to log into the repository. If omitted, self::getCredentials should be used + * * @return \PHPCR\SessionInterface the session resulting from logging into the repository with the provided credentials */ public function getSession($credentials = false) @@ -169,6 +178,7 @@ public function getSession($credentials = false) * Get a session corresponding to the additional workspace for this implementation. * * @param \PHPCR\CredentialsInterface $credentials The credentials to log into the repository. If omitted, self::getCredentials should be used + * * @return \PHPCR\SessionInterface the session resulting from logging into the repository with the provided credentials */ public function getAdditionalSession($credentials = false) @@ -202,7 +212,7 @@ public function getSessionWithLastModified() * mix:lastModified. If that is not possible, this method should return * true, which will skip the test about this feature. * - * @return boolean + * @return bool */ public function doesSessionLastModified() { @@ -223,7 +233,7 @@ public function doesSessionLastModified() */ public function getTestSupported($chapter, $case, $name) { - return ! ( in_array($chapter, $this->unsupportedChapters) + return !(in_array($chapter, $this->unsupportedChapters) || in_array($case, $this->unsupportedCases) || in_array($name, $this->unsupportedTests) ); @@ -232,11 +242,12 @@ public function getTestSupported($chapter, $case, $name) /** * @return \PHPCR\Test\FixtureLoaderInterface implementation that is used to load test fixtures */ - public abstract function getFixtureLoader(); + abstract public function getFixtureLoader(); /** * @param $credentials * @param $workspaceName + * * @return mixed */ private function getSessionForWorkspace($credentials, $workspaceName) diff --git a/lib/BaseCase.php b/lib/BaseCase.php index b4a27643..88f19596 100644 --- a/lib/BaseCase.php +++ b/lib/BaseCase.php @@ -1,9 +1,19 @@ getTestSupported($chapter, $case, null)) { + if (!self::$loader->getTestSupported($chapter, $case, null)) { throw new \PHPUnit_Framework_SkippedTestSuiteError('Test case not supported by this implementation'); } @@ -114,7 +123,7 @@ protected function setUp() { $fqn = get_called_class(); $parts = explode('\\', $fqn); - $case_n = count($parts)-1; + $case_n = count($parts) - 1; $case = $parts[$case_n]; $chapter = ''; @@ -123,9 +132,9 @@ protected function setUp() } $case = $chapter . $case; - $test = "$case::".$this->getName(); + $test = "$case::" . $this->getName(); - if (! self::$loader->getTestSupported($chapter, $case, $test)) { + if (!self::$loader->getTestSupported($chapter, $case, $test)) { $this->markTestSkipped('Test ' . $this->getName() . ' not supported by this implementation'); } @@ -143,7 +152,7 @@ public static function tearDownAfterClass() } /** - * Utility method for tests to get a new session + * Utility method for tests to get a new session. * * Logout from the old session but does *NOT* save the session * @@ -163,7 +172,7 @@ protected function renewSession() } /** - * Utility method for tests to save the session and get a new one + * Utility method for tests to save the session and get a new one. * * Saves the old session and logs it out. * @@ -173,6 +182,7 @@ protected function saveAndRenewSession() { $this->session->save(); $this->renewSession(); + return $this->sharedFixture['session']; } @@ -190,7 +200,7 @@ protected function initProperties() $this->rootNode = $this->session->getRootNode(); - $children = $this->rootNode->getNodes("tests_*"); + $children = $this->rootNode->getNodes('tests_*'); $child = $children->current(); if ($child && $child->hasNode($this->getName())) { $this->node = $child->getNode($this->getName()); @@ -202,7 +212,7 @@ protected function initProperties() *************************************************************************/ /** - * create a session with the given credentials and assert this is a session + * create a session with the given credentials and assert this is a session. * * this is similar to doing self::$loader->getSession($credentials) but * does error handling and asserts the session is a valid SessionInterface @@ -213,7 +223,7 @@ protected function assertSession($credentials = false) { try { $ses = self::$loader->getSession($credentials); - } catch(\PHPCR\RepositoryException $e) { + } catch (\PHPCR\RepositoryException $e) { if ($e->getMessage() == self::NOTSUPPORTEDLOGIN) { $this->markTestSkipped('This implementation does not support this type of login.'); } else { @@ -221,6 +231,7 @@ protected function assertSession($credentials = false) } } $this->assertInstanceOf('PHPCR\SessionInterface', $ses); + return $ses; } @@ -275,7 +286,7 @@ protected function assertSimilarDateTime($expected, $data) * * @param string $descriptor * - * @return boolean True if the test can be done. Otherwise the test is skipped. + * @return bool True if the test can be done. Otherwise the test is skipped. */ protected function skipIfNotSupported($descriptor) { diff --git a/lib/FixtureLoaderInterface.php b/lib/FixtureLoaderInterface.php index 0bb5f2ec..d6c2b272 100644 --- a/lib/FixtureLoaderInterface.php +++ b/lib/FixtureLoaderInterface.php @@ -1,8 +1,18 @@ getRepositoryFactoryClass(); /** @var $factory RepositoryFactoryInterface */ - $factory = new $class; + $factory = new $class(); $repo = $factory->getRepository(self::$loader->getRepositoryFactoryParameters()); $this->assertInstanceOf('PHPCR\RepositoryInterface', $repo); } - } diff --git a/tests/04_Connecting/RepositoryTest.php b/tests/04_Connecting/RepositoryTest.php index 915ca8e4..062c01c0 100644 --- a/tests/04_Connecting/RepositoryTest.php +++ b/tests/04_Connecting/RepositoryTest.php @@ -1,12 +1,19 @@ getRepository(); - if (! self::$loader->prepareAnonymousLogin()) { + if (!self::$loader->prepareAnonymousLogin()) { $this->setExpectedException('PHPCR\LoginException'); } $session = $repository->login(null, self::$loader->getWorkspaceName()); @@ -50,12 +57,12 @@ public function testNoLogin() } /** - * external authentication + * external authentication. */ public function testNoLoginAndWorkspace() { $repository = self::$loader->getRepository(); - if (! self::$loader->prepareAnonymousLogin()) { + if (!self::$loader->prepareAnonymousLogin()) { $this->setExpectedException('PHPCR\LoginException'); } $session = $repository->login(); diff --git a/tests/04_Connecting/SessionReadMethodsTest.php b/tests/04_Connecting/SessionReadMethodsTest.php index b2f1ed7b..b7f95cc5 100644 --- a/tests/04_Connecting/SessionReadMethodsTest.php +++ b/tests/04_Connecting/SessionReadMethodsTest.php @@ -1,9 +1,18 @@ getCredentials(); - if (! $cr instanceof \PHPCR\SimpleCredentials) { + if (!$cr instanceof \PHPCR\SimpleCredentials) { $this->markTestSkipped('This implementation is not using the SimpleCredentials. We can not know if there is anything about attributes. You need to test getAttributeNames in your implementation specific tests'); } $cr->setAttribute('foo', 'bar'); @@ -46,7 +54,7 @@ public function testGetAttributeNames() public function testGetAttribute() { $cr = self::$loader->getCredentials(); - if (! $cr instanceof \PHPCR\SimpleCredentials) { + if (!$cr instanceof \PHPCR\SimpleCredentials) { $this->markTestSkipped('This implementation is not using the SimpleCredentials. We can not know if there is anything about attributes. You need to test getAttribute in your implementation specific tests'); } $cr->setAttribute('foo', 'bar'); diff --git a/tests/04_Connecting/SimpleCredentialsTest.php b/tests/04_Connecting/SimpleCredentialsTest.php index 993f1a56..af0e32f0 100644 --- a/tests/04_Connecting/SimpleCredentialsTest.php +++ b/tests/04_Connecting/SimpleCredentialsTest.php @@ -1,9 +1,18 @@ getNode('deepExample'); $this->assertEquals(array('deepExample'), (array) $deepExample->getNodeNames()); - } + } public function testGetNodesWithFetchDepth() { diff --git a/tests/05_Reading/NodeReadMethodsTest.php b/tests/05_Reading/NodeReadMethodsTest.php index 7512cec3..13f20d49 100644 --- a/tests/05_Reading/NodeReadMethodsTest.php +++ b/tests/05_Reading/NodeReadMethodsTest.php @@ -1,9 +1,18 @@ deepnode->getAncestor($this->deepnode->getDepth()+1); + $this->deepnode->getAncestor($this->deepnode->getDepth() + 1); } public function testGetDepth() @@ -169,11 +178,11 @@ public function testGetNodesRepositoryException() public function testGetNodesPattern() { - $iterator = $this->node->getNodes("idExample"); + $iterator = $this->node->getNodes('idExample'); $nodes = array(); foreach ($iterator as $n) { $this->assertInstanceOf('PHPCR\NodeInterface', $n); - /** @var $n \PHPCR\NodeInterface */ + /* @var $n \PHPCR\NodeInterface */ array_push($nodes, $n->getName()); } $this->assertContains('idExample', $nodes); @@ -187,7 +196,7 @@ public function testGetNodesTypeFilter() $nodes = array(); foreach ($iterator as $n) { $this->assertInstanceOf('PHPCR\NodeInterface', $n); - /** @var $n \PHPCR\NodeInterface */ + /* @var $n \PHPCR\NodeInterface */ array_push($nodes, $n->getName()); } $this->assertContains('index.txt', $nodes); @@ -203,11 +212,11 @@ public function testGetNodesTypeFilter() public function testGetNodesTypeFilterList() { $this->node = $this->rootNode->getNode('tests_general_base'); - $iterator = $this->node->getNodes("id*", array('nt:file', 'nt:folder')); + $iterator = $this->node->getNodes('id*', array('nt:file', 'nt:folder')); $nodes = array(); foreach ($iterator as $n) { $this->assertInstanceOf('PHPCR\NodeInterface', $n); - /** @var $n \PHPCR\NodeInterface */ + /* @var $n \PHPCR\NodeInterface */ array_push($nodes, $n->getName()); } $this->assertNotContains('index.txt', $nodes); @@ -227,7 +236,7 @@ public function testGetNodesNameGlobs() $nodes = array(); foreach ($iterator as $n) { $this->assertInstanceOf('PHPCR\NodeInterface', $n); - /** @var $n \PHPCR\NodeInterface */ + /* @var $n \PHPCR\NodeInterface */ array_push($nodes, $n->getName()); } $this->assertCount(2, $nodes); @@ -253,7 +262,7 @@ public function testGetNodeNames() public function testGetNodeNamesPattern() { - $iterator = $this->node->getNodeNames("id*"); + $iterator = $this->node->getNodeNames('id*'); $names = array(); foreach ($iterator as $n) { array_push($names, $n); @@ -368,7 +377,7 @@ public function testGetPropertiesValuesAll() public function testGetPropertiesValuesAllNoDereference() { $node = $this->session->getNode('/tests_general_base/idExample/jcr:content/weakreference_source1'); - $props = $node->getPropertiesValues(null,false); + $props = $node->getPropertiesValues(null, false); $this->assertInternalType('array', $props); $this->assertArrayHasKey('ref1', $props); $this->assertEquals('13543fc6-1abf-4708-bfcc-e49511754b40', $props['ref1']); @@ -377,7 +386,7 @@ public function testGetPropertiesValuesAllNoDereference() public function testGetPropertiesValuesGlob() { $node = $this->session->getNode('/tests_general_base/idExample/jcr:content/weakreference_source1'); - $props = $node->getPropertiesValues("jcr:*"); + $props = $node->getPropertiesValues('jcr:*'); $this->assertInternalType('array', $props); /* * jcr:mixinTypes is a protected multi-value NAME property @@ -484,7 +493,7 @@ public function testGetReferencesAll() $this->assertInstanceOf('Iterator', $iterator); //there are two nodes with reference to idExample. - $this->assertCount(2, $iterator, "Wrong number of references to idExample"); + $this->assertCount(2, $iterator, 'Wrong number of references to idExample'); foreach ($iterator as $prop) { $this->assertInstanceOf('\PHPCR\PropertyInterface', $prop); $this->assertTrue(in_array($prop, $source)); @@ -492,7 +501,8 @@ public function testGetReferencesAll() } /** - * Test that getReferences() on a non-referenced node will return no references + * Test that getReferences() on a non-referenced node will return no references. + * * @group getReferences */ public function testGetReferencesOnNonReferencedNode() @@ -503,7 +513,7 @@ public function testGetReferencesOnNonReferencedNode() $this->assertInstanceOf('Iterator', $iterator); //there is no node with reference to numberPropertyNode. - $this->assertCount(0, $iterator, "Wrong number of references to numberPropertyNode"); + $this->assertCount(0, $iterator, 'Wrong number of references to numberPropertyNode'); } /** @@ -518,7 +528,7 @@ public function testGetReferencesName() $this->assertInstanceOf('Iterator', $iterator); //there is exactly one node with reference to idExample. - $this->assertCount(1, $iterator, "Wrong number of references with name ref to idExample"); + $this->assertCount(1, $iterator, 'Wrong number of references with name ref to idExample'); foreach ($iterator as $prop) { $this->assertInstanceOf('\PHPCR\PropertyInterface', $prop); $this->assertEquals($source, $prop); @@ -537,7 +547,7 @@ public function testGetReferencesNonexistingName() $target = $this->rootNode->getNode('tests_general_base/idExample'); $iterator = $target->getReferences('notexisting'); $this->assertInstanceOf('Iterator', $iterator); - $this->assertCount(0, $iterator, "Wrong number of references with name notexisting to idExample"); + $this->assertCount(0, $iterator, 'Wrong number of references with name notexisting to idExample'); } /** @@ -554,7 +564,7 @@ public function testGetWeakReferencesAll() $this->assertInstanceOf('Iterator', $iterator); // there are 4 different references, but 2 come from the same property so should only count once. - $this->assertCount(3, $iterator, "Wrong number of weak references to weakreference_target"); + $this->assertCount(3, $iterator, 'Wrong number of weak references to weakreference_target'); foreach ($iterator as $prop) { $this->assertInstanceOf('\PHPCR\PropertyInterface', $prop); $this->assertTrue(in_array($prop, $source, true)); @@ -572,7 +582,7 @@ public function testGetWeakReferencesName() $iterator = $target->getWeakReferences('ref1'); $this->assertInstanceOf('Iterator', $iterator); - $this->assertCount(1, $iterator, "Wrong number of weak references to weakreference_target"); + $this->assertCount(1, $iterator, 'Wrong number of weak references to weakreference_target'); foreach ($iterator as $prop) { $this->assertInstanceOf('\PHPCR\PropertyInterface', $prop); $this->assertEquals($prop, $source); @@ -589,7 +599,7 @@ public function testGetWeakReferencesNonExistingName() $iterator = $target->getWeakReferences('unexisting_name'); $this->assertInstanceOf('Iterator', $iterator); - $this->assertCount(0, $iterator, "Wrong number of weak references to weakreference_target"); + $this->assertCount(0, $iterator, 'Wrong number of weak references to weakreference_target'); } /** @@ -603,7 +613,7 @@ public function testGetWeakReferencesOnNonReferencedNode() $this->assertInstanceOf('Iterator', $iterator); //there is no node with reference to numberPropertyNode. - $this->assertCount(0, $iterator, "Wrong number of references to numberPropertyNode"); + $this->assertCount(0, $iterator, 'Wrong number of references to numberPropertyNode'); } public function testGetSharedSetUnreferenced() diff --git a/tests/05_Reading/PropertyReadMethodsTest.php b/tests/05_Reading/PropertyReadMethodsTest.php index 2b22ccf6..23ef6b02 100644 --- a/tests/05_Reading/PropertyReadMethodsTest.php +++ b/tests/05_Reading/PropertyReadMethodsTest.php @@ -1,10 +1,19 @@ valProperty->getString(); $this->assertInternalType('string', $str); $this->assertEquals('bar', $str); - } public function testJcrCreated() @@ -172,7 +180,7 @@ public function testGetStringMulti() } /** - * everything can be converted to string and then to binary + * everything can be converted to string and then to binary. */ public function testGetBinary() { @@ -218,7 +226,7 @@ public function testGetLongMulti() } } /** - * NAME can not be converted to long + * NAME can not be converted to long. * * @expectedException \PHPCR\ValueFormatException */ @@ -243,7 +251,7 @@ public function testGetDoubleMulti() } } /** - * NAME can not be converted to double + * NAME can not be converted to double. * * @expectedException \PHPCR\ValueFormatException */ @@ -261,7 +269,7 @@ public function testGetDecimal() $this->assertEquals(999, $num); } /** - * NAME can not be converted to decimal + * NAME can not be converted to decimal. * * @expectedException \PHPCR\ValueFormatException */ @@ -270,7 +278,7 @@ public function testGetDecimalValueFormatException() $this->node->getProperty('jcr:primaryType')->getDecimal(); } /** - * The PHP Implementation requires that getDouble and getDecimal return the same + * The PHP Implementation requires that getDouble and getDecimal return the same. */ public function testGetDoubleAndDecimalSame() { @@ -300,13 +308,13 @@ public function testGetDateMulti() $expectedArray = array( new \DateTime('2011-04-22T14:34:20+01:00'), new \DateTime('2011-10-23T14:34:20+01:00'), - new \DateTime('2010-10-23T14:34:20+01:00')); + new \DateTime('2010-10-23T14:34:20+01:00'), ); foreach ($expectedArray as $key => $expected) { $this->assertEqualDateTime($expected, $arr[$key]); } } /** - * arbitrary string can not be converted to date + * arbitrary string can not be converted to date. * * @expectedException \PHPCR\ValueFormatException */ @@ -326,7 +334,7 @@ public function testGetBoolean() $this->assertFalse($prop->getBoolean()); // php interprets everything as true except null, 0, '' and boolean false. thus even the string "false" is true. // we require getString to return something that evaluates to false (the empty string makes sense) - $this->assertTrue(! $prop->getString(), 'boolean false returned as string should evaluate to php '); + $this->assertTrue(!$prop->getString(), 'boolean false returned as string should evaluate to php '); $prop = $this->node->getNode('numberPropertyNode/jcr:content')->getProperty('thisIsYes'); $this->assertTrue($prop->getBoolean()); @@ -346,7 +354,7 @@ public function testGetBooleanMulti() $this->assertTrue($arr[1]); } /** - * NAME can not be converted to boolean + * NAME can not be converted to boolean. * * @expectedException \PHPCR\ValueFormatException */ @@ -389,7 +397,8 @@ public function testGetNodeValueFormatException() $node = $this->dateProperty->getNode(); } /** - * only nodes but not properties can be found with getNode + * only nodes but not properties can be found with getNode. + * * @expectedException \PHPCR\ItemNotFoundException */ public function testGetNodePropertyItemNotFound() @@ -416,7 +425,7 @@ public function testGetNodeWeakItemNotFound() } /** - * PATH property, the path references another property + * PATH property, the path references another property. */ public function testGetProperty() { @@ -561,5 +570,4 @@ public function testIteratorMulti() } $this->assertEquals($expected, $returned); } - } diff --git a/tests/05_Reading/SessionNamespaceRemappingTest.php b/tests/05_Reading/SessionNamespaceRemappingTest.php index 9f2efa25..6892bbd4 100644 --- a/tests/05_Reading/SessionNamespaceRemappingTest.php +++ b/tests/05_Reading/SessionNamespaceRemappingTest.php @@ -1,6 +1,15 @@ 'http://www.jcp.org/jcr/nt/1.0', 'mix' => 'http://www.jcp.org/jcr/mix/1.0', 'xml' => 'http://www.w3.org/XML/1998/namespace', - '' => ''); + '' => '', ); public function testSetNamespacePrefix() { diff --git a/tests/05_Reading/SessionReadMethodsTest.php b/tests/05_Reading/SessionReadMethodsTest.php index dfecb3f8..e414357d 100644 --- a/tests/05_Reading/SessionReadMethodsTest.php +++ b/tests/05_Reading/SessionReadMethodsTest.php @@ -1,9 +1,18 @@ session->getRootNode(); $this->assertInstanceOf('PHPCR\NodeInterface', $node); - $this->assertEquals( '/', $node->getPath()); + $this->assertEquals('/', $node->getPath()); } /** @@ -83,7 +92,7 @@ public function testGetNodes() } /** - * make sure getNodes works with a traversable object as well + * make sure getNodes works with a traversable object as well. */ public function testGetNodesTraversable() { @@ -111,7 +120,8 @@ public function testGetNodesInvalidArgument() } /** - * Get something that is a property and not a node + * Get something that is a property and not a node. + * * @expectedException \PHPCR\PathNotFoundException */ public function testGetNodeInvalid() @@ -119,7 +129,8 @@ public function testGetNodeInvalid() $this->session->getNode('/tests_general_base/idExample/jcr:primaryType'); } /** - * Get something that is a node and not a property + * Get something that is a node and not a property. + * * @expectedException \PHPCR\PathNotFoundException */ public function testGetPropertyInvalid() @@ -179,7 +190,8 @@ public function testGetPropertiesInvalidArgument() } /** - * it is forbidden to call getItem on the session with a relative path + * it is forbidden to call getItem on the session with a relative path. + * * @expectedException \PHPCR\PathNotFoundException */ public function testGetItemRelativePathException() @@ -333,7 +345,8 @@ public function testGetNodeByIdentifierItemNotFoundException() } /** - * spec 4.3 + * spec 4.3. + * * @expectedException JavaException */ public function testImpersonate() diff --git a/tests/06_Query/CharacterTest.php b/tests/06_Query/CharacterTest.php index d8a74427..49458bd6 100644 --- a/tests/06_Query/CharacterTest.php +++ b/tests/06_Query/CharacterTest.php @@ -1,11 +1,19 @@ createQuery( @@ -266,7 +277,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array() ); - /** + /* * 6.7.13. AndConstraint */ @@ -280,7 +291,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.14. OrConstraint */ @@ -294,7 +305,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.15. NotConstraint */ @@ -307,7 +318,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.16. Comparison */ @@ -322,7 +333,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.18. PropertyExistence */ @@ -334,7 +345,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.19. FullTextSearch */ @@ -352,7 +363,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.20. SameNode */ // SELECT * FROM [nt:file] AS file WHERE ISSAMENODE(file, /home) @@ -371,7 +382,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array()); */ - /** + /* * 6.7.21. ChildNode */ // SELECT * FROM [nt:file] AS file WHERE ISCHILDNODE(file, /home) @@ -382,7 +393,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.22. DescendantNode */ // SELECT * FROM [nt:file] AS file WHERE ISDESCENDANTNODE(file, /home) @@ -393,7 +404,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.27. ProperyValue */ @@ -419,7 +430,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.28. Length */ @@ -434,7 +445,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.29. NodeName */ @@ -449,7 +460,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.30. NodeLocalName */ @@ -464,7 +475,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.31. FullTextSearchScore */ @@ -479,7 +490,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.32. LowerCase */ @@ -494,7 +505,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.33. UpperCase */ @@ -509,7 +520,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.35. BindVariable */ @@ -524,7 +535,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) array(), array()); - /** + /* * 6.7.38 Order */ @@ -542,7 +553,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) $factory->selector('u', 'nt:unstructured'), null, array( - $factory->ascending($factory->propertyValue('u', 'prop1'))), + $factory->ascending($factory->propertyValue('u', 'prop1')), ), array()); // SELECT * FROM nt:unstructured ORDER BY prop1 DESC @@ -551,7 +562,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) $factory->selector('u', 'nt:unstructured'), null, array( - $factory->descending($factory->propertyValue('u', 'prop1'))), + $factory->descending($factory->propertyValue('u', 'prop1')), ), array()); // SELECT * FROM nt:unstructured ORDER BY prop1 ASC, prop2 DESC @@ -561,10 +572,10 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) null, array( $factory->ascending($factory->propertyValue('u', 'prop1')), - $factory->descending($factory->propertyValue('u', 'prop2'))), + $factory->descending($factory->propertyValue('u', 'prop2')), ), array()); - /** + /* * 6.7.39 Column */ @@ -583,8 +594,7 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory) null, array(), array( - $factory->column('u', 'prop1', 'col1'))); - + $factory->column('u', 'prop1', 'col1'), )); // SELECT u.prop1, u.prop2 AS col2 FROM nt:unstructured $queries['6.7.39.Colum.Mixed'] = diff --git a/tests/06_Query/QOM/QomToSql2ConverterTest.php b/tests/06_Query/QOM/QomToSql2ConverterTest.php index 8b3a0ba4..d37b113a 100644 --- a/tests/06_Query/QOM/QomToSql2ConverterTest.php +++ b/tests/06_Query/QOM/QomToSql2ConverterTest.php @@ -1,6 +1,15 @@ session->getWorkspace() instanceof \Jackalope\Workspace) { + if (!$this->session->getWorkspace() instanceof \Jackalope\Workspace) { $this->markTestSkipped('TODO: fix the dependency on jackalope and always use the factory'); } @@ -47,7 +56,7 @@ public function setUp() } /** - * 6.7.3. Selector + * 6.7.3. Selector. */ public function testSelector() { @@ -55,7 +64,7 @@ public function testSelector() } /** - * 6.7.8. EquiJoinCondition + * 6.7.8. EquiJoinCondition. */ public function testEquiJoin() { @@ -69,7 +78,7 @@ public function testEquiJoin() } /** - * 6.7.9. SameNodeJoinCondition + * 6.7.9. SameNodeJoinCondition. */ public function testSameNodeJoin() { @@ -84,7 +93,7 @@ public function testSameNodeJoin() } /** - * 6.7.9. SameNodeJoinCondition with space in path + * 6.7.9. SameNodeJoinCondition with space in path. */ public function testSameNodeJoinSpace() { @@ -96,7 +105,7 @@ public function testSameNodeJoinSpace() } /** - * 6.7.10 ChildNodeJoinCondition + * 6.7.10 ChildNodeJoinCondition. */ public function testChildNodeJoin() { @@ -108,7 +117,7 @@ public function testChildNodeJoin() } /** - * 6.7.11 DescendantNodeJoinCondition + * 6.7.11 DescendantNodeJoinCondition. */ public function testDescendantNodeJoin() { @@ -120,7 +129,7 @@ public function testDescendantNodeJoin() } /** - * 6.7.13. AndConstraint + * 6.7.13. AndConstraint. */ public function testAndConstraint() { @@ -131,7 +140,7 @@ public function testAndConstraint() } /** - * 6.7.14. OrConstraint + * 6.7.14. OrConstraint. */ public function testOrConstraint() { @@ -142,7 +151,7 @@ public function testOrConstraint() } /** - * 6.7.15. NotConstraint + * 6.7.15. NotConstraint. */ public function testNotConstraint() { @@ -152,7 +161,7 @@ public function testNotConstraint() } /** - * 6.7.16. Comparison + * 6.7.16. Comparison. */ public function testComparison() { @@ -164,7 +173,7 @@ public function testComparison() } /** - * 6.7.18. PropertyExistence + * 6.7.18. PropertyExistence. */ public function testPropertyExistence() { @@ -173,7 +182,7 @@ public function testPropertyExistence() } /** - * 6.7.19. FullTextSearch + * 6.7.19. FullTextSearch. */ public function testFullTextSearch() { @@ -182,7 +191,7 @@ public function testFullTextSearch() } /** - * 6.7.20. SameNode + * 6.7.20. SameNode. */ public function testSameNode() { @@ -191,7 +200,7 @@ public function testSameNode() } /** - * 6.7.20. SameNode with space in path + * 6.7.20. SameNode with space in path. */ public function testSameNodeSpace() { @@ -200,7 +209,7 @@ public function testSameNodeSpace() } /** - * 6.7.21. ChildNode + * 6.7.21. ChildNode. */ public function testChildNode() { @@ -209,7 +218,7 @@ public function testChildNode() } /** - * 6.7.21. ChildNode with space in path + * 6.7.21. ChildNode with space in path. */ public function testChildNodeSpace() { @@ -218,7 +227,7 @@ public function testChildNodeSpace() } /** - * 6.7.22. DescendantNode + * 6.7.22. DescendantNode. */ public function testDescendantNode() { @@ -227,7 +236,7 @@ public function testDescendantNode() } /** - * 6.7.22. DescendantNode with space in path + * 6.7.22. DescendantNode with space in path. */ public function testDescendantNodeSpace() { @@ -236,18 +245,17 @@ public function testDescendantNodeSpace() } /** - * 6.7.23. Path + * 6.7.23. Path. */ public function testPath() { $selector = $this->factory->selector('file', 'nt:file'); $this->assertQuery($this->queries['6.7.20.SameNode.Selector'], $selector, array(), $this->factory->sameNode('file', '/home'), array()); $this->assertQuery($this->queries['6.7.20.SameNode.Selector'], $selector, array(), $this->factory->sameNode('file', '[/home]'), array()); - } /** - * 6.7.27. ProperyValue + * 6.7.27. ProperyValue. */ public function testPropertyValue() { @@ -260,7 +268,7 @@ public function testPropertyValue() } /** - * 6.7.28. Length + * 6.7.28. Length. */ public function testLength() { @@ -273,7 +281,7 @@ public function testLength() } /** - * 6.7.29. NodeName + * 6.7.29. NodeName. */ public function testNodeName() { @@ -286,7 +294,7 @@ public function testNodeName() } /** - * 6.7.30. NodeLocalName + * 6.7.30. NodeLocalName. */ public function testNodeLocalName() { @@ -299,7 +307,7 @@ public function testNodeLocalName() } /** - * 6.7.31. FullTextSearchScore + * 6.7.31. FullTextSearchScore. */ public function testFullTextSearchScore() { @@ -312,7 +320,7 @@ public function testFullTextSearchScore() } /** - * 6.7.32. LowerCase + * 6.7.32. LowerCase. */ public function testLowerCase() { @@ -325,7 +333,7 @@ public function testLowerCase() } /** - * 6.7.33. UpperCase + * 6.7.33. UpperCase. */ public function testUpperCase() { @@ -338,7 +346,7 @@ public function testUpperCase() } /** - * 6.7.35. BindVariable + * 6.7.35. BindVariable. */ public function testBindVariable() { @@ -351,7 +359,7 @@ public function testBindVariable() } /** - * 6.7.38 Order + * 6.7.38 Order. */ public function testOrdering() { @@ -365,7 +373,7 @@ public function testOrdering() } /** - * 6.7.39 Column + * 6.7.39 Column. */ public function testColumns() { diff --git a/tests/06_Query/QOM/Sql2ScannerTest.php b/tests/06_Query/QOM/Sql2ScannerTest.php index c6ee8497..94a544da 100644 --- a/tests/06_Query/QOM/Sql2ScannerTest.php +++ b/tests/06_Query/QOM/Sql2ScannerTest.php @@ -1,11 +1,20 @@ tokens = array( 'SELECT', '*', 'FROM','[nt:file]', 'INNER', 'JOIN', '[nt:folder]', - 'ON', 'ISSAMENODE', '(', 'sel1', ',', 'sel2', ',', '[/home]', ')'); + 'ON', 'ISSAMENODE', '(', 'sel1', ',', 'sel2', ',', '[/home]', ')', ); } public function testConstructor() diff --git a/tests/06_Query/QOM/Sql2TestQueries.php b/tests/06_Query/QOM/Sql2TestQueries.php index 5f482049..ce6698d7 100644 --- a/tests/06_Query/QOM/Sql2TestQueries.php +++ b/tests/06_Query/QOM/Sql2TestQueries.php @@ -1,10 +1,21 @@ \'hello\'))', ); - /** + /* * 6.7.13. AndConstraint */ $queries['6.7.13.And'] = array( @@ -89,7 +100,7 @@ public static function getQueries() 'SELECT * FROM [nt:file] AS file WHERE (file.prop1 IS NOT NULL AND file.prop2 IS NOT NULL)', ); - /** + /* * 6.7.14. OrConstraint */ $queries['6.7.14.Or'] = array( @@ -97,7 +108,7 @@ public static function getQueries() 'SELECT * FROM [nt:file] AS file WHERE (file.prop1 IS NOT NULL OR file.prop2 IS NOT NULL)', ); - /** + /* * 6.7.15. NotConstraint */ $queries['6.7.15.Not'] = array( @@ -105,23 +116,23 @@ public static function getQueries() 'SELECT * FROM [nt:file] AS file WHERE (NOT file.prop1 IS NOT NULL)', ); - /** + /* * 6.7.16. Comparison */ - $queries['6.7.16.Comparison'] = 'SELECT * FROM [nt:file] AS file WHERE NAME(file) LIKE \'literal2\'';; + $queries['6.7.16.Comparison'] = 'SELECT * FROM [nt:file] AS file WHERE NAME(file) LIKE \'literal2\''; - /** + /* * 6.7.18. PropertyExistence */ $queries['6.7.18.PropertyExistence'] = 'SELECT * FROM [nt:file] AS file WHERE file.prop1 IS NOT NULL'; - /** + /* * 6.7.19. FullTextSearch */ $queries['6.7.19.FullTextSearch'] = 'SELECT * FROM [nt:file] AS file WHERE CONTAINS(file.prop, \'expr\')'; $queries['6.7.19.FullTextSearch_With_Single_Quote'] = "SELECT * FROM [nt:file] AS file WHERE CONTAINS(file.prop, 'expr''')"; - /** + /* * 6.7.20. SameNode */ $queries['6.7.20.SameNode.Selector'] = 'SELECT * FROM [nt:file] AS file WHERE ISSAMENODE(file, [/home])'; @@ -130,7 +141,7 @@ public static function getQueries() 'SELECT * FROM [nt:file] AS file WHERE ISSAMENODE(file, [/home node])', ); - /** + /* * 6.7.21. ChildNode */ $queries['6.7.21.ChildNode.Selector'] = 'SELECT * FROM [nt:file] AS file WHERE ISCHILDNODE(file, [/home])'; @@ -139,57 +150,57 @@ public static function getQueries() 'SELECT * FROM [nt:file] AS file WHERE ISCHILDNODE(file, [/home node])', ); - /** + /* * 6.7.22. DescendantNode */ $queries['6.7.22.DescendantNode.Selector'] = 'SELECT * FROM [nt:file] AS file WHERE ISDESCENDANTNODE(file, [/home])'; $queries['6.7.22.DescendantNode.Selector_Space'] = array( 'SELECT * FROM [nt:file] AS file WHERE ISDESCENDANTNODE(file, ["/home node"])', - 'SELECT * FROM [nt:file] AS file WHERE ISDESCENDANTNODE(file, [/home node])' + 'SELECT * FROM [nt:file] AS file WHERE ISDESCENDANTNODE(file, [/home node])', ); - /** + /* * 6.7.27. PropertyValue */ $queries['6.7.27.PropertyValue'] = 'SELECT * FROM [nt:file] AS file WHERE file.prop LIKE \'literal\''; $queries['6.7.27.1.PropertyValue'] = 'SELECT * FROM [nt:unstructured] AS sel WHERE sel.prop > CAST(\'2013-04-15T00:00:00.000+02:00\' AS DATE)'; - /** + /* * 6.7.28. Length */ $queries['6.7.28.Length'] = 'SELECT * FROM [nt:file] AS file WHERE LENGTH(file.prop) LIKE \'literal\''; - /** + /* * 6.7.29. NodeName */ $queries['6.7.29.NodeName'] = 'SELECT * FROM [nt:file] AS file WHERE NAME(file) LIKE \'literal\''; - /** + /* * 6.7.30. NodeLocalName */ $queries['6.7.30.NodeLocalName'] = 'SELECT * FROM [nt:file] AS file WHERE LOCALNAME(file) LIKE \'literal\''; - /** + /* * 6.7.31. FullTextSearchScore */ $queries['6.7.31.FullTextSearchScore'] = 'SELECT * FROM [nt:file] AS file WHERE SCORE(file) LIKE \'literal\''; - /** + /* * 6.7.32. LowerCase */ $queries['6.7.32.LowerCase'] = 'SELECT * FROM [nt:file] AS file WHERE LOWER(NAME(file)) LIKE \'literal\''; - /** + /* * 6.7.33. UpperCase */ $queries['6.7.33.UpperCase'] = 'SELECT * FROM [nt:file] AS file WHERE UPPER(NAME(file)) LIKE \'literal\''; - /** + /* * 6.7.35. BindVariable */ $queries['6.7.35.BindValue'] = 'SELECT * FROM [nt:file] AS file WHERE UPPER(NAME(file)) LIKE $var'; - /** + /* * 6.7.38 Order */ $queries['6.7.38.Order.None'] = 'SELECT * FROM [nt:unstructured] AS u'; @@ -197,7 +208,7 @@ public static function getQueries() $queries['6.7.38.Order.Desc'] = 'SELECT * FROM [nt:unstructured] AS u ORDER BY u.prop1 DESC'; $queries['6.7.38.Order.Mixed'] = 'SELECT * FROM [nt:unstructured] AS u ORDER BY u.prop1 ASC, u.prop2 DESC'; - /** + /* * 6.7.39 Column */ $queries['6.7.39.Colum.Wildcard'] = 'SELECT * FROM [nt:unstructured] AS u'; diff --git a/tests/06_Query/QOM/Sql2ToQomConverterTest.php b/tests/06_Query/QOM/Sql2ToQomConverterTest.php index 85a77769..85e1847f 100644 --- a/tests/06_Query/QOM/Sql2ToQomConverterTest.php +++ b/tests/06_Query/QOM/Sql2ToQomConverterTest.php @@ -1,6 +1,15 @@ query + * The results to be expected in $this->query. * * @var array */ protected $resultPaths; /** - * in addition to base stuff, prepare the query manager and load general/query fixture + * in addition to base stuff, prepare the query manager and load general/query fixture. * * @param string $fixture name of the fixture to load, defaults to general/base */ @@ -31,26 +40,26 @@ public static function setupBeforeClass($fixture = 'general/base') } /** - * in addition to base stuff, prepare $this->query with a simple select query + * in addition to base stuff, prepare $this->query with a simple select query. */ public function setUp() { parent::setUp(); - $this->query = $this->sharedFixture['qm']->createQuery(" + $this->query = $this->sharedFixture['qm']->createQuery(' SELECT * FROM [nt:folder] WHERE ISDESCENDANTNODE([/tests_general_base]) OR ISSAMENODE([/tests_general_base]) - ", + ', \PHPCR\Query\QueryInterface::JCR_SQL2 ); // the query result is not ordered, but these are the nodes that are to be expected in any order - $this->resultPaths = array("/tests_general_base", - "/tests_general_base/test:namespacedNode", - "/tests_general_base/emptyExample", - "/tests_general_base/multiValueProperty/deepnode", - "/tests_general_base/multiValueProperty"); + $this->resultPaths = array('/tests_general_base', + '/tests_general_base/test:namespacedNode', + '/tests_general_base/emptyExample', + '/tests_general_base/multiValueProperty/deepnode', + '/tests_general_base/multiValueProperty', ); } } diff --git a/tests/06_Query/QueryManagerTest.php b/tests/06_Query/QueryManagerTest.php index e86ca807..22d8b7f5 100644 --- a/tests/06_Query/QueryManagerTest.php +++ b/tests/06_Query/QueryManagerTest.php @@ -1,9 +1,18 @@ factory = $this->sharedFixture['qm']->getQOMFactory(); } catch (\Exception $e) { - $this->markTestSkipped('Can not get the QOM factory, skipping tests about QOM query. '.$e->getMessage()); + $this->markTestSkipped('Can not get the QOM factory, skipping tests about QOM query. ' . $e->getMessage()); } $source = $this->factory->selector('data', 'nt:folder'); @@ -43,7 +51,7 @@ public function setUp() $orderings = array(); $columns = array(); - $this->query = $this->factory->createQuery($source,$constraint,$orderings,$columns); + $this->query = $this->factory->createQuery($source, $constraint, $orderings, $columns); } public function testExecute() @@ -67,19 +75,19 @@ public function testExecuteInvalid() $orderings = array(); $columns = array(); - $query = $this->factory->createQuery($source,$constraint,$orderings,$columns); + $query = $this->factory->createQuery($source, $constraint, $orderings, $columns); $query->execute(); } public function testGetStatement() { - $this->assertEquals('SELECT * FROM [nt:folder] AS data '. + $this->assertEquals('SELECT * FROM [nt:folder] AS data ' . 'WHERE (ISDESCENDANTNODE(data, [/tests_general_base]) OR ISSAMENODE(data, [/tests_general_base]))', $this->query->getStatement()); } /** * Even though the query is defined with QOM, it must return JCR_SQL2 as langugae: - * http://www.day.com/specs/jcr/2.0/6_Query.html#6.9.3%20Getting%20the%20Language + * http://www.day.com/specs/jcr/2.0/6_Query.html#6.9.3%20Getting%20the%20Language. */ public function testGetLanguage() { @@ -87,7 +95,8 @@ public function testGetLanguage() } /** - * a transient query has no stored query path + * a transient query has no stored query path. + * * @expectedException \PHPCR\ItemNotFoundException */ public function testGetStoredQueryPathItemNotFound() diff --git a/tests/06_Query/QueryObjectSql2Test.php b/tests/06_Query/QueryObjectSql2Test.php index d80fd364..6df4fd6e 100644 --- a/tests/06_Query/QueryObjectSql2Test.php +++ b/tests/06_Query/QueryObjectSql2Test.php @@ -1,9 +1,18 @@ assertEquals($columnNamesExpected, $columnNames); + $this->assertEquals($columnNamesExpected, $columnNames); } public function testGetAliasColumnNames() { - $query = $this->sharedFixture['qm']->createQuery(" + $query = $this->sharedFixture['qm']->createQuery(' SELECT [jcr:mimeType] AS bar, stringToCompare as foo, [nt:unstructured].longNumberToCompare, ding FROM [nt:unstructured] WHERE stringToCompare IS NOT NULL - ", + ', \PHPCR\Query\QueryInterface::JCR_SQL2 ); $qr = $query->execute(); @@ -69,7 +78,6 @@ public function testGetAliasColumnNames() $this->assertNotNull($row->getValue('longNumberToCompare')); $this->assertEquals('', $row->getValue('ding')); } - } public function testGetNodes() @@ -130,7 +138,9 @@ public function testReadPropertyContentFromResults() $this->assertTrue(count($this->qr->getNodes()) > 0); foreach ($this->qr->getNodes() as $path => $node) { - if ($seekName == $path) break; + if ($seekName == $path) { + break; + } } $this->assertInstanceOf('PHPCR\NodeInterface', $node); @@ -195,7 +205,7 @@ public function testBooleanField() $this->assertCount(1, $rows); $this->assertEquals(false, $rows[0]->getValue('data.thisIsNo')); - $query = $this->sharedFixture['qm']->createQuery( + $query = $this->sharedFixture['qm']->createQuery( 'SELECT data.thisIsYes FROM [nt:unstructured] as data WHERE data.thisIsYes = true', \PHPCR\Query\QueryInterface::JCR_SQL2 ); diff --git a/tests/06_Query/QuerySql2OperationsTest.php b/tests/06_Query/QuerySql2OperationsTest.php index 81cd6959..c1157b3c 100644 --- a/tests/06_Query/QuerySql2OperationsTest.php +++ b/tests/06_Query/QuerySql2OperationsTest.php @@ -1,11 +1,20 @@ assertCount(3, $rows, 'Expected 3 nodes with a (binary) jcr:data property with length 121'); } - } diff --git a/tests/06_Query/RowIteratorTest.php b/tests/06_Query/RowIteratorTest.php index aed9c18e..ce8e9cbc 100644 --- a/tests/06_Query/RowIteratorTest.php +++ b/tests/06_Query/RowIteratorTest.php @@ -1,9 +1,18 @@ assertEquals(array('nt:folder.jcr:created', 'nt:folder.jcr:createdBy', 'nt:folder.jcr:primaryType'), $keys); - } public function testGetValue() diff --git a/tests/06_Query/Sql1/QueryBaseCase.php b/tests/06_Query/Sql1/QueryBaseCase.php index 7b82d333..fba7f7f5 100644 --- a/tests/06_Query/Sql1/QueryBaseCase.php +++ b/tests/06_Query/Sql1/QueryBaseCase.php @@ -1,20 +1,28 @@ query with a simple select query + * in addition to base stuff, prepare $this->query with a simple select query. */ public function setUp() { parent::setUp(); - $this->query = $this->sharedFixture['qm']->createQuery("SELECT * FROM nt:folder", \PHPCR\Query\QueryInterface::JCR_SQL2); + $this->query = $this->sharedFixture['qm']->createQuery('SELECT * FROM nt:folder', \PHPCR\Query\QueryInterface::JCR_SQL2); } - } diff --git a/tests/06_Query/Sql1/QueryOperationsTest.php b/tests/06_Query/Sql1/QueryOperationsTest.php index f6f12178..556bcfb2 100644 --- a/tests/06_Query/Sql1/QueryOperationsTest.php +++ b/tests/06_Query/Sql1/QueryOperationsTest.php @@ -1,11 +1,20 @@ assertEquals(array(null, null, null, null, null, null, null, null, null, 0), $vals); } - } diff --git a/tests/06_Query/XPath/QueryBaseCase.php b/tests/06_Query/XPath/QueryBaseCase.php index 804f5e18..f4c42b5c 100644 --- a/tests/06_Query/XPath/QueryBaseCase.php +++ b/tests/06_Query/XPath/QueryBaseCase.php @@ -1,20 +1,28 @@ query with a simple select query + * in addition to base stuff, prepare $this->query with a simple select query. */ public function setUp() { parent::setUp(); - $this->query = $this->sharedFixture['qm']->createQuery("//element(*,nt:folder)", \PHPCR\Query\QueryInterface::XPATH); + $this->query = $this->sharedFixture['qm']->createQuery('//element(*,nt:folder)', \PHPCR\Query\QueryInterface::XPATH); } - } diff --git a/tests/06_Query/XPath/QueryOperationsTest.php b/tests/06_Query/XPath/QueryOperationsTest.php index 122ff1da..5aa2ea45 100644 --- a/tests/06_Query/XPath/QueryOperationsTest.php +++ b/tests/06_Query/XPath/QueryOperationsTest.php @@ -1,11 +1,20 @@ assertEquals(array(null, null, null, null, null, null, null, null, null, 0), $vals); } - } diff --git a/tests/07_Export/ExportRepositoryContentTest.php b/tests/07_Export/ExportRepositoryContentTest.php index 241dc889..21f68c6c 100644 --- a/tests/07_Export/ExportRepositoryContentTest.php +++ b/tests/07_Export/ExportRepositoryContentTest.php @@ -1,8 +1,21 @@ loadXML(stream_get_contents($stream)); $expected = new DOMDocument(); $expected->preserveWhiteSpace = false; - $expected->load(__DIR__.'/../../fixtures/07_Export/systemview.xml'); + $expected->load(__DIR__ . '/../../fixtures/07_Export/systemview.xml'); fclose($stream); $this->assertEquivalentSystem($expected->documentElement, $output->documentElement, new DOMXPath($output)); } @@ -36,13 +49,13 @@ public function testExportSystemView() private function buildPath(DOMNode $n) { $ret = ''; - while (! $n instanceof DOMDocument) { + while (!$n instanceof DOMDocument) { if ($n instanceof DOMElement && in_array($n->tagName, array('sv:node', 'sv:property'))) { $name = $n->attributes->getNamedItem('name'); if ($name == null) { $elem = 'sv:node(unnamed)'; } else { - $elem = $n->tagName.'('.$name->value.')'; + $elem = $n->tagName . '(' . $name->value . ')'; } } else { $elem = $n->nodeName; @@ -72,7 +85,7 @@ private function assertEquivalentSystem(DOMElement $expected, DOMElement $output foreach ($expected->attributes as $attr) { //i.e. sv:name attribute $oattr = $output->attributes->getNamedItem($attr->name); - $this->assertNotNull($oattr, 'missing attribute '.$attr->name); + $this->assertNotNull($oattr, 'missing attribute ' . $attr->name); $this->assertEquals($attr->value, $oattr->value, 'wrong attribute value'); } @@ -84,12 +97,12 @@ private function assertEquivalentSystem(DOMElement $expected, DOMElement $output foreach ($expected->childNodes as $index => $child) { $this->assertEquals('sv:value', $child->tagName); $o = $output->childNodes->item($index); - $this->assertInstanceOf('DOMElement', $o, "No child element at $index in ".$this->buildPath($child)); - $this->assertEquals('sv:value', $o->tagName, 'Unexpected tag name at '.$this->buildPath($expected)."sv:value[$index]"); + $this->assertInstanceOf('DOMElement', $o, "No child element at $index in " . $this->buildPath($child)); + $this->assertEquals('sv:value', $o->tagName, 'Unexpected tag name at ' . $this->buildPath($expected) . "sv:value[$index]"); if ($this->isDate($child->textContent) && $this->isDate($o->textContent)) { - $this->assertEqualDateString($child->textContent, $o->textContent, 'Not the same date at '.$this->buildPath($output)."sv:value[$index]"); + $this->assertEqualDateString($child->textContent, $o->textContent, 'Not the same date at ' . $this->buildPath($output) . "sv:value[$index]"); } else { - $this->assertEquals($child->textContent, $o->textContent, 'Not the same text at '.$this->buildPath($output)."sv:value[$index]"); + $this->assertEquals($child->textContent, $o->textContent, 'Not the same text at ' . $this->buildPath($output) . "sv:value[$index]"); } } } @@ -98,8 +111,8 @@ private function assertEquivalentSystem(DOMElement $expected, DOMElement $output foreach ($expected->childNodes as $child) { $this->assertContains($child->tagName, array('sv:property', 'sv:node'), 'unexpected child of sv:node'); $childname = $child->attributes->getNamedItem('name')->value; - $q = $oxpath->query($child->tagName.'[@sv:name="'.$childname.'"]', $output); - $this->assertEquals(1, $q->length, 'expected to find exactly one node named '.$childname.' under '.$this->buildPath($output)); + $q = $oxpath->query($child->tagName . '[@sv:name="' . $childname . '"]', $output); + $this->assertEquals(1, $q->length, 'expected to find exactly one node named ' . $childname . ' under ' . $this->buildPath($output)); $this->assertEquivalentSystem($child, $q->item(0), $oxpath); } } @@ -115,7 +128,7 @@ public function testExportDocumentView() $output->loadXML(stream_get_contents($stream)); $expected = new DOMDocument(); $expected->preserveWhiteSpace = false; - $expected->load(__DIR__.'/../../fixtures/07_Export/documentview.xml'); + $expected->load(__DIR__ . '/../../fixtures/07_Export/documentview.xml'); fclose($stream); $this->assertEquivalentDocument($expected->documentElement, $output->documentElement, new DOMXPath($output)); } @@ -129,7 +142,7 @@ public function testExportDocumentView() private function assertEquivalentDocument(DOMElement $expected, DOMElement $output, DOMXPath $oxpath) { if ($expected instanceof DOMText) { - $this->assertEquals($expected->textContent, $output->textContent, 'Not the same text at '.$this->buildPath($expected)); + $this->assertEquals($expected->textContent, $output->textContent, 'Not the same text at ' . $this->buildPath($expected)); } elseif ($expected instanceof DOMElement) { $this->assertEquals($expected->tagName, $output->tagName); @@ -138,18 +151,18 @@ private function assertEquivalentDocument(DOMElement $expected, DOMElement $outp $this->assertNotEmpty($attr->value); } else { $oattr = $output->attributes->getNamedItem($attr->name); - $this->assertNotNull($oattr, 'missing attribute '.$attr->name.' at '.$this->buildPath($expected)); + $this->assertNotNull($oattr, 'missing attribute ' . $attr->name . ' at ' . $this->buildPath($expected)); if ($this->isDate($attr->value) && $this->isDate($oattr->value)) { - $this->assertEqualDateString($attr->value, $oattr->value, 'wrong attribute value at '.$this->buildPath($expected).'/'.$attr->name); + $this->assertEqualDateString($attr->value, $oattr->value, 'wrong attribute value at ' . $this->buildPath($expected) . '/' . $attr->name); } else { - $this->assertEquals($attr->value, $oattr->value, 'wrong attribute value at '.$this->buildPath($expected).'/'.$attr->name); + $this->assertEquals($attr->value, $oattr->value, 'wrong attribute value at ' . $this->buildPath($expected) . '/' . $attr->name); } } } foreach ($expected->childNodes as $child) { $q = $oxpath->query($child->tagName, $output); //TODO: same-name siblings - $this->assertEquals(1, $q->length, 'expected to find exactly one node named '.$child->tagName.' under '.$this->buildPath($expected)); + $this->assertEquals(1, $q->length, 'expected to find exactly one node named ' . $child->tagName . ' under ' . $this->buildPath($expected)); $this->assertEquivalentDocument($child, $q->item(0), $oxpath); } } diff --git a/tests/08_NodeTypeDiscovery/NodeDefinitionTest.php b/tests/08_NodeTypeDiscovery/NodeDefinitionTest.php index 9aa887a2..63b5bf42 100644 --- a/tests/08_NodeTypeDiscovery/NodeDefinitionTest.php +++ b/tests/08_NodeTypeDiscovery/NodeDefinitionTest.php @@ -1,9 +1,18 @@ getNodeType and NodeTypeDefinition->getChildNodeDefinitions() works correctly */ @@ -22,8 +31,8 @@ public static function setupBeforeClass($fixtures = false) parent::setupBeforeClass($fixtures); $ntm = self::$staticSharedFixture['session']->getWorkspace()->getNodeTypeManager(); self::$file = $ntm->getNodeType('nt:file'); - self::$folder= $ntm->getNodeType('nt:folder'); - self::$hierarchyNodeType= $ntm->getNodeType('nt:hierarchyNode'); + self::$folder = $ntm->getNodeType('nt:folder'); + self::$hierarchyNodeType = $ntm->getNodeType('nt:hierarchyNode'); } public function setUp() @@ -42,9 +51,8 @@ public function setUp() list($key, $this->hierarchyNodeDef) = each($defs); $this->assertInstanceOf('\PHPCR\NodeType\NodeDefinitionInterface', $this->hierarchyNodeDef); $this->assertEquals('*', $this->hierarchyNodeDef->getName()); - } catch (\Exception $e) { - $this->markTestSkipped('getChildNodeDefinitions not working as it should, skipping tests about NodeDefinitionInterface: '.$e->getMessage()); + $this->markTestSkipped('getChildNodeDefinitions not working as it should, skipping tests about NodeDefinitionInterface: ' . $e->getMessage()); } } public function testAllowsSameNameSiblings() diff --git a/tests/08_NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php b/tests/08_NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php index 3284c596..605035e7 100644 --- a/tests/08_NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php +++ b/tests/08_NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php @@ -1,9 +1,18 @@ getNodeType works correctly */ @@ -146,7 +155,7 @@ public function testGetPropertyDefinitions() $properties = self::$file->getPropertyDefinitions(); $this->assertInternalType('array', $properties); $this->assertCount(4, $properties); - $names=array(); + $names = array(); foreach ($properties as $prop) { $this->assertInstanceOf('\PHPCR\NodeType\PropertyDefinitionInterface', $prop); $names[] = $prop->getName(); @@ -172,7 +181,7 @@ public function testIsNodeTypeMixin() /** * If your implementation supports versioning, this test checks if isNodeType * works for parent mixin types as well. - * If the repository does not declare it supports versioning, this test is skipped + * If the repository does not declare it supports versioning, this test is skipped. */ public function testIsNodeTypeMixinVersion() { diff --git a/tests/08_NodeTypeDiscovery/PropertyDefinitionTest.php b/tests/08_NodeTypeDiscovery/PropertyDefinitionTest.php index 787c9dd0..9b1018fd 100644 --- a/tests/08_NodeTypeDiscovery/PropertyDefinitionTest.php +++ b/tests/08_NodeTypeDiscovery/PropertyDefinitionTest.php @@ -1,10 +1,20 @@ getNodeType and NodeTypeDefinition->getPropertyDefinitions() works correctly */ @@ -35,7 +45,6 @@ public static function setupBeforeClass($fixtures = false) self::$address = $ntm->getNodeType('nt:address'); self::$mix_created = $ntm->getNodeType('mix:created'); self::$resource = $ntm->getNodeType('nt:resource'); - } public function setUp() @@ -98,7 +107,7 @@ public function setUp() } $this->assertNotNull($this->data); } catch (\Exception $e) { - $this->markTestSkipped('getChildNodeDefinitions not working as it should, skipping tests about NodeDefinitionInterface: '.$e->getMessage()); + $this->markTestSkipped('getChildNodeDefinitions not working as it should, skipping tests about NodeDefinitionInterface: ' . $e->getMessage()); } } @@ -111,7 +120,7 @@ public function testGetAvailableQueryOperators() QueryObjectModelConstantsInterface::JCR_OPERATOR_LESS_THAN_OR_EQUAL_TO, QueryObjectModelConstantsInterface::JCR_OPERATOR_GREATER_THAN, QueryObjectModelConstantsInterface::JCR_OPERATOR_GREATER_THAN_OR_EQUAL_TO, - QueryObjectModelConstantsInterface::JCR_OPERATOR_LIKE + QueryObjectModelConstantsInterface::JCR_OPERATOR_LIKE, ); asort($ops); diff --git a/tests/09_PermissionsAndCapabilities/PermissionReadTest.php b/tests/09_PermissionsAndCapabilities/PermissionReadTest.php index d92c6806..a4175025 100644 --- a/tests/09_PermissionsAndCapabilities/PermissionReadTest.php +++ b/tests/09_PermissionsAndCapabilities/PermissionReadTest.php @@ -1,10 +1,18 @@ assertFalse($this->session->hasCapability('inexistentXXX', $property, array())); //actually, the repository is not required to know, it can always say that the info can not be determined and return true. this makes me think that this method is pretty useless... } - } diff --git a/tests/10_Writing/AddMethodsTest.php b/tests/10_Writing/AddMethodsTest.php index 6cf91f38..a3c34b1f 100644 --- a/tests/10_Writing/AddMethodsTest.php +++ b/tests/10_Writing/AddMethodsTest.php @@ -1,6 +1,15 @@ renewSession(); parent::setUp(); //all tests in this suite rely on the trick to have the node populated from the fixtures - $this->assertInstanceOf('PHPCR\NodeInterface', $this->node, "Something went wrong with fixture loading"); + $this->assertInstanceOf('PHPCR\NodeInterface', $this->node, 'Something went wrong with fixture loading'); } public function testAddNode() @@ -39,7 +47,6 @@ public function testAddNode() $this->renewSession(); $this->assertNotNull($this->session->getNode($this->node->getPath() . '/newNode'), 'Node newNode was not properly saved'); - } public function testAddNodeWithPath() @@ -88,7 +95,6 @@ public function testAddNodeUnstructuredType() $this->renewSession(); $this->assertNotNull($this->session->getNode($this->node->getPath() . '/newUnstructuredNode'), 'Node newUnstructuredNode was not created'); - } /** @@ -271,6 +277,7 @@ public function testAddNodeInParallel() /** * try to add a node below a not existing node. + * * @expectedException \PHPCR\PathNotFoundException */ public function testAddNodePathNotFound() @@ -279,7 +286,7 @@ public function testAddNodePathNotFound() } /** - * try to add a node below a property + * try to add a node below a property. * * @expectedException \PHPCR\NodeType\ConstraintViolationException */ @@ -289,7 +296,7 @@ public function testAddNodeToProperty() } /** - * try to add a property of the wrong type + * try to add a property of the wrong type. */ public function testAddPropertyWrongType() { @@ -305,8 +312,7 @@ public function testAddPropertyWrongType() //also correct return; } - $this->fail("Expected PHPCR\\NodeType\\ConstraintViolationException or PHPCR\\ValueFormatException"); - + $this->fail('Expected PHPCR\\NodeType\\ConstraintViolationException or PHPCR\\ValueFormatException'); } /** @@ -318,7 +324,7 @@ public function testAddNodeWithIndex() } /** - * Add a node and a child node to it + * Add a node and a child node to it. */ public function testAddNodeChild() { @@ -338,7 +344,7 @@ public function testAddNodeChild() } /** - * Add a node and a child node with some properties + * Add a node and a child node with some properties. */ public function testAddNodeChildProperties() { @@ -355,7 +361,8 @@ public function testAddNodeChildProperties() } /** - * try to add a node with an unregistered namespace + * try to add a node with an unregistered namespace. + * * @expectedException \PHPCR\RepositoryException */ public function testAddNodeWithUnregisteredNamespace() @@ -371,7 +378,8 @@ public function testAddNodeWithUnregisteredNamespace() } /** - * try to add a property with an unregistered namespace + * try to add a property with an unregistered namespace. + * * @expectedException \PHPCR\RepositoryException */ public function testAddPropertyWithUnregisteredNamespace() @@ -393,7 +401,7 @@ public function testAddNodeWithAutoCreatedNode() } $workspace = $this->session->getWorkspace(); - $cnd = file_get_contents(__DIR__.'/../../fixtures/10_Writing/add_auto_create.cnd'); + $cnd = file_get_contents(__DIR__ . '/../../fixtures/10_Writing/add_auto_create.cnd'); $workspace->getNodeTypeManager()->registerNodeTypesCnd($cnd, true); $this->node->addNode('foo', 'test:testautocreate'); $this->session->save(); diff --git a/tests/10_Writing/CloneMethodsTest.php b/tests/10_Writing/CloneMethodsTest.php index 02fa63da..cc643734 100644 --- a/tests/10_Writing/CloneMethodsTest.php +++ b/tests/10_Writing/CloneMethodsTest.php @@ -1,13 +1,22 @@ getSession(); try { @@ -243,7 +252,7 @@ public function testExistingNonCorrespondingNodeNoRemoveExisting() } /** - * Test when source node is non-referenceable but a referenceable node exists at destination path + * Test when source node is non-referenceable but a referenceable node exists at destination path. * * @expectedException \PHPCR\ItemExistsException */ @@ -324,7 +333,7 @@ public function testCloneDstParentNotFound() } /** - * Main test for cloning a non-referenceable node + * Main test for cloning a non-referenceable node. */ public function testCloneNonReferenceable() { @@ -342,7 +351,7 @@ public function testCloneNonReferenceable() } /** - * Clone a non-referenceable node, then clone again with removeExisting = true + * Clone a non-referenceable node, then clone again with removeExisting = true. * * @expectedException \PHPCR\ItemExistsException */ @@ -393,7 +402,7 @@ public function testCloneNonReferenceableNoRemoveExisting() public function testGetCorrespondingNode() { $srcNode = '/tests_write_manipulation_clone/testWorkspaceCorrespondingNode/sourceNode'; - $dstNode = '/tests_write_manipulation_clone/testWorkspaceCorrespondingNode/destNode';; + $dstNode = '/tests_write_manipulation_clone/testWorkspaceCorrespondingNode/destNode'; $destSession = self::$destWs->getSession(); self::$destWs->cloneFrom($this->srcWsName, $srcNode, $dstNode, false); @@ -441,12 +450,12 @@ public function testGetCorrespondingNodeItemNotFound() /** * Main test for cloning and then updating a node and its children. - * Using two levels of children to make sure copy works recursively (and affected nodes not cached) + * Using two levels of children to make sure copy works recursively (and affected nodes not cached). */ public function testUpdateNodeWithChildren() { $srcNode = '/tests_write_manipulation_clone/testWorkspaceUpdateNode/sourceNode'; - $dstNode = '/tests_write_manipulation_clone/testWorkspaceUpdateNode/destNode';; + $dstNode = '/tests_write_manipulation_clone/testWorkspaceUpdateNode/destNode'; $srcChildNode = $srcNode . '/cloneChild'; $dstChildNode = $dstNode . '/cloneChild'; $srcChildOfChildNode = $srcChildNode . '/childOfChild'; @@ -524,7 +533,7 @@ public function testUpdateNoSuchWorkspace() /** * Test that update has no effect if the source node not found - * (from JCR spec 10.8.3: "If this node does not have a corresponding node in srcWorkspace, then the method has no effect.") + * (from JCR spec 10.8.3: "If this node does not have a corresponding node in srcWorkspace, then the method has no effect."). */ public function testUpdateSrcNotFound() { diff --git a/tests/10_Writing/CombinedManipulationsTest.php b/tests/10_Writing/CombinedManipulationsTest.php index a4a97c5b..678c3a00 100644 --- a/tests/10_Writing/CombinedManipulationsTest.php +++ b/tests/10_Writing/CombinedManipulationsTest.php @@ -1,9 +1,18 @@ assertTrue($this->session->nodeExists($path)); $this->assertTrue($this->node->hasNode('child')); - } /** - * add a node and remove it immediately without persisting + * add a node and remove it immediately without persisting. * * should not do anything at the backend */ @@ -116,7 +124,7 @@ public function testAddAndRemove() } /** - * add a property and remove it immediately without persisting + * add a property and remove it immediately without persisting. * * should not do anything at the backend */ @@ -144,7 +152,7 @@ public function testAddAndRemoveProperty() } /** - * Remove a property and in the same session remove its containing node + * Remove a property and in the same session remove its containing node. */ public function testRemovePropertyAndNode() { @@ -170,7 +178,7 @@ public function testRemovePropertyAndNode() } /** - * remove a node and then add a new one at the same path and then remove again + * remove a node and then add a new one at the same path and then remove again. * * in the end, the node must disapear */ @@ -202,7 +210,7 @@ public function testRemoveAndAddAndRemove() } /** - * remove a node and then add a new one at the same path and then remove again + * remove a node and then add a new one at the same path and then remove again. * * in the end, the node must disapear */ @@ -243,7 +251,7 @@ public function testAddAndRemoveAndAdd() public function testRemoveAndAddToplevelNode() { $nodename = 'toBeDeleted'; - if (! $this->rootNode->hasNode($nodename)) { + if (!$this->rootNode->hasNode($nodename)) { $this->rootNode->addNode($nodename, 'nt:unstructured'); } $session = $this->saveAndRenewSession(); @@ -265,7 +273,7 @@ public function testRemoveAndAddToplevelNode() public function testRemoveAndAddAndRemoveToplevelNode() { $nodename = 'toBeDeleted'; - if (! $this->rootNode->hasNode($nodename)) { + if (!$this->rootNode->hasNode($nodename)) { $this->rootNode->addNode($nodename, 'nt:unstructured'); } $session = $this->saveAndRenewSession(); @@ -285,18 +293,18 @@ public function testRemoveAndAddAndRemoveToplevelNode() } /** - * remove a node and then move another node at the same path + * remove a node and then move another node at the same path. */ public function testRemoveAndMove() { - $node = $this->session->getNode($this->node->getPath().'/parent/child'); + $node = $this->session->getNode($this->node->getPath() . '/parent/child'); $path = $node->getPath(); $this->assertInstanceOf('PHPCR\NodeType\NodeTypeInterface', $node->getPrimaryNodeType()); $this->assertSame('nt:unstructured', $node->getPrimaryNodeType()->getName()); $node->remove(); $this->assertFalse($this->session->nodeExists($path)); - $this->session->move($this->node->getPath().'/other', $path); + $this->session->move($this->node->getPath() . '/other', $path); $this->assertTrue($this->session->nodeExists($path)); $parent = $this->node->getNode('parent'); $this->assertTrue($parent->hasNode('child')); @@ -349,7 +357,7 @@ public function testAddAndChildAddAndMove() } /** - * From /src/parent/child we remove child, then move parent to /target and then remove /src + * From /src/parent/child we remove child, then move parent to /target and then remove /src. * * We should be left with /target */ @@ -381,7 +389,7 @@ public function testRemoveMoveRemove() } /** - * Move a node, then remove one of its properties, then move it again + * Move a node, then remove one of its properties, then move it again. */ public function testMoveRemovepropertyMove() { @@ -413,7 +421,7 @@ public function testMoveRemovepropertyMove() } /** - * Move a node and then try to access one of its children (needs the new path) + * Move a node and then try to access one of its children (needs the new path). */ public function testLoadchildMovedNode() { @@ -438,7 +446,7 @@ public function testLoadchildMovedNode() public function testSessionHasPendingChanges() { $this->assertFalse($this->session->hasPendingChanges()); - $this->node->setProperty('prop', "New"); + $this->node->setProperty('prop', 'New'); $this->assertTrue($this->session->hasPendingChanges()); } @@ -520,7 +528,6 @@ public function testRemoveSessionRefresh() $this->assertTrue($node->hasNode('child')); $this->assertTrue($this->session->nodeExists($node->getPath() . '/child')); $this->assertSame($child, $this->session->getNode($node->getPath() . '/child')); - } public function testRemoveSessionRefreshKeepChanges() @@ -559,14 +566,14 @@ public function testRemoveSessionRefreshKeepChanges() /** * remove a child node and a property in a different session. should - * disappear on refresh, even if we want to keep changes + * disappear on refresh, even if we want to keep changes. */ public function testRemoveOtherSessionRefreshKeepChanges() { $node = $this->node; $path = $node->getPath(); $child = $node->getNode('childnode'); - $childprop = $this->session->getProperty($node->getPath().'/child/childprop'); + $childprop = $this->session->getProperty($node->getPath() . '/child/childprop'); $node->setProperty('newprop', 'Value'); @@ -691,8 +698,8 @@ public function testAddSessionRefresh() $this->assertFalse($node->hasNode('child')); $this->assertFalse($node->hasProperty('prop')); - $this->assertFalse($this->session->nodeExists($node->getPath().'/child')); - $this->assertFalse($this->session->propertyExists($node->getPath().'/prop')); + $this->assertFalse($this->session->nodeExists($node->getPath() . '/child')); + $this->assertFalse($this->session->propertyExists($node->getPath() . '/prop')); $this->setExpectedException('\PHPCR\PathNotFoundException'); $node->getNode('child'); @@ -713,8 +720,8 @@ public function testAddSessionRefreshKeepChanges() $this->assertTrue($node->hasProperty('prop')); $this->assertSame($property, $node->getProperty('prop')); - $this->assertTrue($this->session->nodeExists($node->getPath().'/child')); - $this->assertTrue($this->session->propertyExists($node->getPath().'/prop')); + $this->assertTrue($this->session->nodeExists($node->getPath() . '/child')); + $this->assertTrue($this->session->propertyExists($node->getPath() . '/prop')); $this->session->save(); $this->assertTrue($node->hasNode('child')); @@ -722,8 +729,8 @@ public function testAddSessionRefreshKeepChanges() $this->assertTrue($node->hasProperty('prop')); $this->assertSame($property, $node->getProperty('prop')); - $this->assertTrue($this->session->nodeExists($node->getPath().'/child')); - $this->assertTrue($this->session->propertyExists($node->getPath().'/prop')); + $this->assertTrue($this->session->nodeExists($node->getPath() . '/child')); + $this->assertTrue($this->session->propertyExists($node->getPath() . '/prop')); $session = $this->renewSession(); $node = $session->getNode($path); @@ -733,8 +740,8 @@ public function testAddSessionRefreshKeepChanges() $this->assertTrue($node->hasProperty('prop')); $this->assertSame('Test', $node->getPropertyValue('prop')); - $this->assertTrue($session->nodeExists($node->getPath().'/child')); - $this->assertTrue($session->propertyExists($node->getPath().'/prop')); + $this->assertTrue($session->nodeExists($node->getPath() . '/child')); + $this->assertTrue($session->propertyExists($node->getPath() . '/prop')); } public function testNodeRevert() @@ -751,8 +758,8 @@ public function testNodeRevert() $this->assertSame('Old', $existingProperty->getValue()); $this->assertFalse($node->hasNode('child')); $this->assertFalse($node->hasProperty('other')); - $this->assertFalse($this->session->nodeExists($node->getPath().'/child')); - $this->assertFalse($this->session->propertyExists($node->getPath().'/other')); + $this->assertFalse($this->session->nodeExists($node->getPath() . '/child')); + $this->assertFalse($this->session->propertyExists($node->getPath() . '/other')); $this->setExpectedException('\PHPCR\PathNotFoundException'); $node->getPropertyValue('other'); diff --git a/tests/10_Writing/CopyMethodsTest.php b/tests/10_Writing/CopyMethodsTest.php index 596a012d..43b68004 100644 --- a/tests/10_Writing/CopyMethodsTest.php +++ b/tests/10_Writing/CopyMethodsTest.php @@ -1,11 +1,20 @@ session->getNode("$dst/srcFile"); $this->assertNotEquals($schild->getIdentifier(), $dchild->getIdentifier()); - $this->assertTrue($this->session->nodeExists($dst.'/srcFile/jcr:content'), 'Did not copy the whole subgraph'); + $this->assertTrue($this->session->nodeExists($dst . '/srcFile/jcr:content'), 'Did not copy the whole subgraph'); $sfile = $this->session->getNode("$src/srcFile/jcr:content"); $dfile = $this->session->getNode("$dst/srcFile/jcr:content"); @@ -173,7 +182,7 @@ public function testCopyDstParentNotFound() } /** - * Verifies that there is no update-on-copy if the target node already exists + * Verifies that there is no update-on-copy if the target node already exists. * * @expectedException \PHPCR\ItemExistsException */ @@ -203,7 +212,7 @@ public function testCopyUpdateReferencesSingleValue() $references = $node->getReferences(); $this->assertCount(2, $references); - $this->session->refresh(true ); + $this->session->refresh(true); $node = $this->session->getNode($ref); $references = $node->getReferences(); @@ -213,7 +222,7 @@ public function testCopyUpdateReferencesSingleValue() /** * Copied nodes which reference other nodes should be shown in the referrers list of references - * Multi-value + * Multi-value. */ public function testCopyUpdateReferencesMultiValue() { diff --git a/tests/10_Writing/DeleteMethodsTest.php b/tests/10_Writing/DeleteMethodsTest.php index 639f65a2..745b4d2b 100644 --- a/tests/10_Writing/DeleteMethodsTest.php +++ b/tests/10_Writing/DeleteMethodsTest.php @@ -1,11 +1,20 @@ session->removeItem($this->node->getPath()); $this->assertFalse($parent->hasNode('testRemoveItemNode'), 'Node was not removed'); - $this->assertFalse($this->session->nodeExists($parent->getPath().'/testRemoveItemNode')); + $this->assertFalse($this->session->nodeExists($parent->getPath() . '/testRemoveItemNode')); $this->saveAndRenewSession(); - $this->assertFalse($this->session->nodeExists($parent->getPath().'/testRemoveItemNode')); + $this->assertFalse($this->session->nodeExists($parent->getPath() . '/testRemoveItemNode')); } /** - * \PHPCR\SessionInterface::removeItem + * \PHPCR\SessionInterface::removeItem. */ public function testRemoveItemProperty() { @@ -56,7 +65,8 @@ public function testRemoveItemProperty() } /** - * \PHPCR\SessionInterface::removeItem + * \PHPCR\SessionInterface::removeItem. + * * @expectedException \PHPCR\NodeType\ConstraintViolationException */ public function testRemoveNodeConstraintViolation() @@ -68,7 +78,8 @@ public function testRemoveNodeConstraintViolation() } /** - * \PHPCR\SessionInterface::removeItem + * \PHPCR\SessionInterface::removeItem. + * * @expectedException \PHPCR\PathNotFoundException */ public function testRemoveItemNotExisting() @@ -77,7 +88,7 @@ public function testRemoveItemNotExisting() } /** - * Check if state of cached parent node is updated correctly + * Check if state of cached parent node is updated correctly. * * \PHPCR\ItemInterface::remove */ @@ -116,7 +127,7 @@ public function testRemoveNodeWhitespace() } /** - * Check if state of parent that was not cached when delete was executed is correct + * Check if state of parent that was not cached when delete was executed is correct. * * \PHPCR\ItemInterface::remove */ @@ -124,29 +135,29 @@ public function testRemoveNodeParentState() { //relies on the base class setup trick to have the node populated from the fixtures $this->assertInstanceOf('PHPCR\NodeInterface', $this->node); - $path = $this->node->getPath().'/parent/child'; + $path = $this->node->getPath() . '/parent/child'; $child = $this->session->getNode($path); $child->remove(); - $parent = $this->session->getNode($this->node->getPath().'/parent'); + $parent = $this->session->getNode($this->node->getPath() . '/parent'); $this->assertFalse($parent->hasNode('child')); $this->assertFalse($this->session->nodeExists($path)); $session = $this->saveAndRenewSession(); $this->assertFalse($session->nodeExists($path)); - $parent = $session->getNode($this->node->getPath().'/parent'); + $parent = $session->getNode($this->node->getPath() . '/parent'); $this->assertFalse($parent->hasNode('child')); } /** - * add a node, save it, remove it, save again, try to access the removed node + * add a node, save it, remove it, save again, try to access the removed node. */ public function testRemoveNodeFromBackend() { $nodename = 'toBeDeleted'; - if (! $this->rootNode->hasNode($nodename)) { + if (!$this->rootNode->hasNode($nodename)) { $this->rootNode->addNode($nodename, 'nt:unstructured'); $this->session->save(); $this->renewSession(); @@ -164,7 +175,7 @@ public function testRemoveNodeFromBackend() } /** - * add a property, save it, remove it, save again, try to access the removed property + * add a property, save it, remove it, save again, try to access the removed property. */ public function testRemovePropertyFromBackend() { @@ -180,12 +191,11 @@ public function testRemovePropertyFromBackend() $this->setExpectedException('\PHPCR\PathNotFoundException'); $this->session->getNode('/')->getProperty('toBeDeletedProperty'); - } /** * \PHPCR\PropertyInterface::remove - * \PHPCR\PropertyInterface::setValue + * \PHPCR\PropertyInterface::setValue. */ public function testRemoveProperty() { @@ -208,7 +218,7 @@ public function testRemoveProperty() } /** - * \PHPCR\NodeInterface::setProperty + * \PHPCR\NodeInterface::setProperty. */ public function testNodeRemoveProperty() { @@ -222,11 +232,11 @@ public function testNodeRemoveProperty() } /** - * \PHPCR\NodeInterface::setProperty + * \PHPCR\NodeInterface::setProperty. */ public function testNodeRemovePropertyNotExisting() { -// $this->node->setProperty('inexistent', null); + // $this->node->setProperty('inexistent', null); $this->markTestIncomplete('TODO: figure out what should happen when inexistant property is removed'); //relies on the base class setup trick to have the node populated from the fixtures @@ -234,7 +244,8 @@ public function testNodeRemovePropertyNotExisting() } /** - * \PHPCR\NodeInterface::setProperty + * \PHPCR\NodeInterface::setProperty. + * * @expectedException \PHPCR\NodeType\ConstraintViolationException */ public function testNodeRemovePropertyConstraintViolation() @@ -246,7 +257,8 @@ public function testNodeRemovePropertyConstraintViolation() } /** - * \PHPCR\NodeInterface::setProperty + * \PHPCR\NodeInterface::setProperty. + * * @expectedException \PHPCR\NodeType\ConstraintViolationException */ public function testRemovePropertyConstraintViolation() @@ -259,7 +271,8 @@ public function testRemovePropertyConstraintViolation() /** * \PHPCR\NodeInterface::remove - * \PHPCR\SessionInterface::getNode + * \PHPCR\SessionInterface::getNode. + * * @expectedException \PHPCR\PathNotFoundException */ public function testGetRemovedNodeSession() @@ -274,7 +287,8 @@ public function testGetRemovedNodeSession() /** * \PHPCR\NodeInterface::remove - * \PHPCR\NodeInterface::getNode + * \PHPCR\NodeInterface::getNode. + * * @expectedException \PHPCR\PathNotFoundException */ public function testGetRemovedNodeNode() @@ -290,7 +304,8 @@ public function testGetRemovedNodeNode() /** * \PHPCR\NodeInterface::remove - * \PHPCR\SessionInterface::getNode + * \PHPCR\SessionInterface::getNode. + * * @expectedException \PHPCR\PathNotFoundException */ public function testGetRemovedPropertySession() @@ -306,7 +321,8 @@ public function testGetRemovedPropertySession() /** * \PHPCR\NodeInterface::remove - * \PHPCR\NodeInterface::getNode + * \PHPCR\NodeInterface::getNode. + * * @expectedException \PHPCR\PathNotFoundException */ public function testGetRemovedPropertyNode() @@ -321,7 +337,8 @@ public function testGetRemovedPropertyNode() } /** - * try to remove a node that has already been removed in this session + * try to remove a node that has already been removed in this session. + * * @expectedException \PHPCR\PathNotFoundException */ public function testRemoveRemovedNode() @@ -335,7 +352,7 @@ public function testRemoveRemovedNode() } /** - * Try to call revert on a property that has been removed in this session + * Try to call revert on a property that has been removed in this session. * * @expectedException \PHPCR\InvalidItemStateException */ @@ -349,7 +366,7 @@ public function testRevertRemovedProperty() } /** - * deleting a node must cascade to its children + * deleting a node must cascade to its children. */ public function testDeleteCascade() { @@ -371,7 +388,7 @@ public function testDeleteCascade() $items = array($this->node, $ptest, $prop, $child, $childprop, $childchild, $childchildprop); foreach ($items as $item) { try { - $this->fail('Should not be able to get path of deleted item '.$item->getPath()); // this should explode + $this->fail('Should not be able to get path of deleted item ' . $item->getPath()); // this should explode } catch (\PHPCR\InvalidItemStateException $e) { // the exception is expected } @@ -389,7 +406,7 @@ public function testDeleteCascade() foreach ($items as $item) { try { - $this->fail('Should not be able to get path of deleted item '.$item->getPath()); // this should explode + $this->fail('Should not be able to get path of deleted item ' . $item->getPath()); // this should explode } catch (\PHPCR\InvalidItemStateException $e) { // the exception is expected } @@ -397,7 +414,7 @@ public function testDeleteCascade() } /** - * It is not allowed to delete a referenced node + * It is not allowed to delete a referenced node. * * @expectedException \PHPCR\ReferentialIntegrityException */ @@ -413,7 +430,7 @@ public function testDeleteReferencedNodeException() /** * however, if the reference is first deleted, it must be possible to - * delete the node + * delete the node. */ public function testDeletePreviouslyReferencedNode() { @@ -434,7 +451,7 @@ public function testDeletePreviouslyReferencedNode() } /** - * it must be possible to delete a weakly referenced node + * it must be possible to delete a weakly referenced node. */ public function testDeleteWeakReferencedNode() { @@ -450,7 +467,7 @@ public function testDeleteWeakReferencedNode() /** * test if deleting a node and creating a node at the same path with a new UUID - * won't cause trouble with internally cached UUID's + * won't cause trouble with internally cached UUID's. */ public function testDeleteNodeAndReusePathWithReference() { @@ -469,13 +486,13 @@ public function testDeleteNodeAndReusePathWithReference() try { $this->session->getNodeByIdentifier($uuid); $this->fail('Removed node was still found'); - } catch(ItemNotFoundException $e) { + } catch (ItemNotFoundException $e) { // expected } try { $this->session->getNodeByIdentifier($childUuid); $this->fail('Removed child node was still found'); - } catch(ItemNotFoundException $e) { + } catch (ItemNotFoundException $e) { // expected } @@ -523,8 +540,8 @@ public function testWorkspaceDelete() // Session $this->assertFalse($this->session->nodeExists($path)); - $this->assertFalse($this->session->nodeExists($path.'/child')); - $this->assertFalse($this->session->propertyExists($path.'/child/prop')); + $this->assertFalse($this->session->nodeExists($path . '/child')); + $this->assertFalse($this->session->propertyExists($path . '/child/prop')); try { $this->node->getPath(); $this->fail('Node was not notified that it is deleted'); @@ -541,7 +558,7 @@ public function testWorkspaceDelete() // Backend $this->session = $this->saveAndRenewSession(); $this->assertFalse($this->session->nodeExists($path)); - $this->assertFalse($this->session->nodeExists($path.'/child')); + $this->assertFalse($this->session->nodeExists($path . '/child')); } public function testWorkspaceDeleteProperty() diff --git a/tests/10_Writing/EncodingTest.php b/tests/10_Writing/EncodingTest.php index a53de8f3..4728c3d3 100644 --- a/tests/10_Writing/EncodingTest.php +++ b/tests/10_Writing/EncodingTest.php @@ -1,6 +1,15 @@ session instanceof \Jackalope\Session) { + if (!$this->session instanceof \Jackalope\Session) { $this->markTestSkipped('This test is only meant for Jackalope'); //TODO: this is a unit test that belongs into jackalope } diff --git a/tests/10_Writing/LastModifiedTest.php b/tests/10_Writing/LastModifiedTest.php index 47c90d78..32199ba1 100644 --- a/tests/10_Writing/LastModifiedTest.php +++ b/tests/10_Writing/LastModifiedTest.php @@ -1,9 +1,17 @@ assertTrue($child->hasProperty('jcr:created')); $date = $child->getPropertyValue('jcr:created'); $this->assertInstanceOf('DateTime', $date); - /** @var $date \DateTime */ + /* @var $date \DateTime */ $diff = time() - $date->getTimestamp(); - $this->assertTrue($diff < 60*10, "jcr:created should be current date as fixture was just imported: ".$date->format('c')); + $this->assertTrue($diff < 60 * 10, 'jcr:created should be current date as fixture was just imported: ' . $date->format('c')); // Re-read the node to be sure things got properly saved $this->renewSession(); @@ -46,6 +55,6 @@ public function testCreationNode() $date = $child->getPropertyValue('jcr:created'); $this->assertInstanceOf('DateTime', $date); $diff = time() - $date->getTimestamp(); - $this->assertTrue($diff < 60*10, "jcr:created should be current date as fixture was just imported: ".$date->format('c')); + $this->assertTrue($diff < 60 * 10, 'jcr:created should be current date as fixture was just imported: ' . $date->format('c')); } } diff --git a/tests/10_Writing/MixinReferenceableTest.php b/tests/10_Writing/MixinReferenceableTest.php index 45fc26e9..aad045a4 100644 --- a/tests/10_Writing/MixinReferenceableTest.php +++ b/tests/10_Writing/MixinReferenceableTest.php @@ -1,11 +1,20 @@ assertTrue($this->session->nodeExists($dst), 'Destination node not found [S]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [S]'); - $this->assertTrue($this->session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [S]'); + $this->assertTrue($this->session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [S]'); $dstNode = $this->session->getNode($dst); $this->assertInstanceOf('PHPCR\NodeInterface', $dstNode); @@ -65,17 +73,17 @@ public function testSessionMove() $this->session->save(); $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($this->session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [B]'); + $this->assertTrue($this->session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [B]'); // Backend $session = $this->renewSession(); $this->assertTrue($session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [B]'); + $this->assertTrue($session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [B]'); } /** - * Try to move nodes: + * Try to move nodes:. * * src: /my/path * dst: /my/new/path @@ -116,13 +124,13 @@ public function testSessionMoveSimilarSiblings() $this->assertTrue($session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($session->nodeExists($src), 'Source node still exists [B]'); $this->assertTrue($session->nodeExists($dst . '/another'), 'Destination child node not found [B]'); - $this->assertFalse($session->nodeExists($src. '/another'), 'Source child node still exists [B]'); + $this->assertFalse($session->nodeExists($src . '/another'), 'Source child node still exists [B]'); $this->assertTrue($session->nodeExists($probSrc), 'Sibling nodes should\'nt be moved'); $this->assertFalse($session->nodeExists($probDst), 'Sibling nodes should\'nt be moved'); } /** - * Try to move nodes that are already held in memory: + * Try to move nodes that are already held in memory:. * * src: /my/path * dst: /my/new/path @@ -166,7 +174,7 @@ public function testSessionMoveSimilarSiblingsInMemory() $this->assertTrue($session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($session->nodeExists($src), 'Source node still exists [B]'); $this->assertTrue($session->nodeExists($dst . '/another'), 'Destination child node not found [B]'); - $this->assertFalse($session->nodeExists($src. '/another'), 'Source child node still exists [B]'); + $this->assertFalse($session->nodeExists($src . '/another'), 'Source child node still exists [B]'); $this->assertTrue($session->nodeExists($probSrc), 'Sibling nodes should\'nt be moved'); $this->assertFalse($session->nodeExists($probDst), 'Sibling nodes should\'nt be moved'); } @@ -181,7 +189,7 @@ public function testSessionMoveWhitespace() // Session $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [S]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [S]'); - $this->assertTrue($this->session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [S]'); + $this->assertTrue($this->session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [S]'); $dstNode = $this->session->getNode($dst); $this->assertInstanceOf('PHPCR\NodeInterface', $dstNode); @@ -189,17 +197,17 @@ public function testSessionMoveWhitespace() $this->session->save(); $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($this->session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [B]'); + $this->assertTrue($this->session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [B]'); // Backend $session = $this->renewSession(); $this->assertTrue($session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [B]'); + $this->assertTrue($session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [B]'); } /** - * Makes sure that UUID is not modified during a move for mix:referenceable nodes + * Makes sure that UUID is not modified during a move for mix:referenceable nodes. */ public function testSessionMoveReferenceable() { @@ -224,7 +232,7 @@ public function testSessionMoveReferenceable() /** * Verifies that locally cached node itself knows about the move and Node::getPath() - * returns the new path + * returns the new path. */ public function testSessionMovePathUpdated() { @@ -248,14 +256,14 @@ public function testSessionMovePathUpdatedChild() // load nodes $parent = $this->session->getNode($src); - $child = $this->session->getNode($src.'/srcChild'); + $child = $this->session->getNode($src . '/srcChild'); $this->session->move($src, $dst); $this->assertEquals("$dst/srcChild", $child->getPath()); $this->assertEquals($dst, $parent->getPath()); $this->assertSame($parent, $this->session->getNode($dst)); - $this->assertSame($child, $this->session->getNode($dst.'/srcChild')); + $this->assertSame($child, $this->session->getNode($dst . '/srcChild')); } /** Verifies a moved node still has the child node */ @@ -312,9 +320,9 @@ public function testSessionMoveMoved() public function testSessionMoveReplace() { - $src = $this->node->getPath().'/node'; - $dst = $this->node->getPath().'/moved'; - $src2 = $this->node->getPath().'/replacement'; + $src = $this->node->getPath() . '/node'; + $dst = $this->node->getPath() . '/moved'; + $src2 = $this->node->getPath() . '/replacement'; $this->node->getNode('node'); $this->node->getNode('replacement'); @@ -380,7 +388,7 @@ public function testSessionMoveAdded() } /** - * Adds a node, moves its child + * Adds a node, moves its child. */ public function testSessionMoveChildAdded() { @@ -406,7 +414,7 @@ public function testSessionMoveChildAdded() } /** - * Moves a node and then moves its child + * Moves a node and then moves its child. */ public function testSessionMoveChildMoved() { @@ -415,7 +423,7 @@ public function testSessionMoveChildMoved() $dst2 = '/tests_write_manipulation_move/testSessionMoveChildMoved/srcFile'; $this->session->move($src, $dst); - $this->session->move($dst.'/srcFile', $dst2); + $this->session->move($dst . '/srcFile', $dst2); // Session $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [S]'); diff --git a/tests/10_Writing/NamespaceRegistryTest.php b/tests/10_Writing/NamespaceRegistryTest.php index c12a19be..f959e285 100644 --- a/tests/10_Writing/NamespaceRegistryTest.php +++ b/tests/10_Writing/NamespaceRegistryTest.php @@ -1,9 +1,18 @@ 'http://www.jcp.org/jcr/nt/1.0', 'mix' => 'http://www.jcp.org/jcr/mix/1.0', 'xml' => 'http://www.w3.org/XML/1998/namespace', - '' => ''); + '' => '', ); public function setUp() { @@ -142,7 +151,6 @@ public function testIterator() $this->assertInternalType('string', $url); $this->assertEquals($url, $this->nr->getURI($prefix)); } - $this->assertTrue($results>3, 'Not enough namespaces'); + $this->assertTrue($results > 3, 'Not enough namespaces'); } - } diff --git a/tests/10_Writing/NodeTypeAssignementTest.php b/tests/10_Writing/NodeTypeAssignementTest.php index d999642d..d4970205 100644 --- a/tests/10_Writing/NodeTypeAssignementTest.php +++ b/tests/10_Writing/NodeTypeAssignementTest.php @@ -1,6 +1,15 @@ node->addNode('parent-'.strtr($mixin, ':', '-'), 'nt:unstructured'); + $newNode = $this->node->addNode('parent-' . strtr($mixin, ':', '-'), 'nt:unstructured'); $newNode->addMixin($mixin); $path = $newNode->getPath(); $session = $this->saveAndRenewSession(); @@ -81,7 +90,7 @@ public function testAddMixinOnExistingNode($mixin) /** * adding an already existing mixin should not set the node into the modified state - * adding a mixin to a node that already has a mixin in the permanent storage should work too + * adding a mixin to a node that already has a mixin in the permanent storage should work too. */ public function testAddMixinTwice() { @@ -122,7 +131,8 @@ public function testAddMixinPrimaryType() } /** - * Test that assigning an unexisting mixin type to a node will fail + * Test that assigning an unexisting mixin type to a node will fail. + * * @expectedException \PHPCR\NodeType\NoSuchNodeTypeException */ public function testAddMixinNonexisting() diff --git a/tests/10_Writing/NodeTypePreemptiveValidationTest.php b/tests/10_Writing/NodeTypePreemptiveValidationTest.php index ec08dfe3..30e55b0e 100644 --- a/tests/10_Writing/NodeTypePreemptiveValidationTest.php +++ b/tests/10_Writing/NodeTypePreemptiveValidationTest.php @@ -1,12 +1,21 @@ assertTrue($this->file->canRemoveProperty('jcr:mimeType')); $this->assertFalse($this->file->canRemoveProperty('jcr:created')); } - } diff --git a/tests/10_Writing/SetPropertyDynamicRebindingTest.php b/tests/10_Writing/SetPropertyDynamicRebindingTest.php index b95a26ef..2b3c43e7 100644 --- a/tests/10_Writing/SetPropertyDynamicRebindingTest.php +++ b/tests/10_Writing/SetPropertyDynamicRebindingTest.php @@ -1,6 +1,15 @@ node->setProperty('multivalue', array(1, 2, 3)); - $this->assertEquals(array(1,2,3), $this->node->getPropertyValue('multivalue')); + $this->assertEquals(array(1, 2, 3), $this->node->getPropertyValue('multivalue')); $this->assertEquals(\PHPCR\PropertyType::LONG, $prop->getType()); $this->assertTrue($prop->isMultiple()); @@ -155,7 +164,7 @@ public function testSetPropertyMultivalue() $prop = $node->getProperty('multivalue'); $this->assertEquals(\PHPCR\PropertyType::LONG, $prop->getType()); $this->assertTrue($prop->isMultiple()); - $this->assertEquals(array(1,2,3), $prop->getValue()); + $this->assertEquals(array(1, 2, 3), $prop->getValue()); } public function testSetPropertyMultivalueOne() @@ -236,17 +245,17 @@ public function testSetPropertyMultivalueRef() public function testPropertyAddValue() { $prop = $this->node->getProperty('multiBoolean'); - $this->assertEquals(array(false,true), $prop->getValue()); + $this->assertEquals(array(false, true), $prop->getValue()); $this->assertTrue($prop->isMultiple()); $prop->addValue(true); - $this->assertEquals(array(false,true,true), $prop->getValue()); + $this->assertEquals(array(false, true, true), $prop->getValue()); $this->saveAndRenewSession(); $node = $this->session->getNode($this->nodePath); $prop = $node->getProperty('multiBoolean'); $this->assertEquals(\PHPCR\PropertyType::BOOLEAN, $prop->getType()); $this->assertTrue($prop->isMultiple()); - $this->assertEquals(array(false,true,true), $prop->getValue()); + $this->assertEquals(array(false, true, true), $prop->getValue()); } /** @@ -264,7 +273,7 @@ public function testPropertyAddValueNoMultivalue() public function testPropertySetValueNoMultivalue() { $prop = $this->node->getProperty('longNumber'); - $prop->setValue(array(33,34)); + $prop->setValue(array(33, 34)); } public function testNewNodeSetProperty() diff --git a/tests/10_Writing/SetPropertyTypesTest.php b/tests/10_Writing/SetPropertyTypesTest.php index 557b0a8f..ba37f2bc 100644 --- a/tests/10_Writing/SetPropertyTypesTest.php +++ b/tests/10_Writing/SetPropertyTypesTest.php @@ -1,12 +1,21 @@ assertEquals(\PHPCR\PropertyType::LONG, $value->getType()); } - public function testCreateValueDouble() { $value = $this->node->setProperty('propDouble', 10.6); diff --git a/tests/11_Import/ImportRepositoryContentTest.php b/tests/11_Import/ImportRepositoryContentTest.php index fec7e3e1..59d560a8 100644 --- a/tests/11_Import/ImportRepositoryContentTest.php +++ b/tests/11_Import/ImportRepositoryContentTest.php @@ -1,9 +1,18 @@ doTestImportXMLSystem($session, $session); } /** - * Import to empty repository with various data + * Import to empty repository with various data. */ public function testImportXMLSystemWorkspace() { @@ -33,7 +42,7 @@ public function testImportXMLSystemWorkspace() private function doTestImportXMLSystem($connect, $session) { - $connect->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $connect->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); $this->assertTrue($session->nodeExists('/tests_general_base')); $this->assertTrue($session->propertyExists('/tests_general_base/idExample/jcr:content/weakreference_target/jcr:uuid')); @@ -63,14 +72,14 @@ private function doTestImportXMLSystem($connect, $session) */ public function testImportXMLSystemPathNotFoundSession() { - $this->session->importXML('/inexistent-path', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $this->session->importXML('/inexistent-path', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); } /** * @expectedException \PHPCR\PathNotFoundException */ public function testImportXMLSystemPathNotFoundWorkspace() { - $this->session->getWorkspace()->importXML('/inexistent-path', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $this->session->getWorkspace()->importXML('/inexistent-path', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); } /** @@ -80,7 +89,7 @@ public function testImportXMLSystemIdCollisionSession() { self::$staticSharedFixture['ie']->import('11_Import/idnode'); $session = $this->renewSession(); - $session->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $session->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); } /** @@ -90,29 +99,31 @@ public function testImportXMLSystemIdCollisionWorkspace() { self::$staticSharedFixture['ie']->import('11_Import/idnode'); $session = $this->renewSession(); - $session->getWorkspace()->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $session->getWorkspace()->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); } /** - * try to replace the path to which we are importing atm + * try to replace the path to which we are importing atm. + * * @expectedException \PHPCR\NodeType\ConstraintViolationException */ public function testImportXMLUuidRemoveParentSession() { self::$staticSharedFixture['ie']->import('11_Import/idnode'); $session = $this->renewSession(); - $session->importXML('/container/idExample', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); + $session->importXML('/container/idExample', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); } /** - * try to replace the path to which we are importing atm + * try to replace the path to which we are importing atm. + * * @expectedException \PHPCR\NodeType\ConstraintViolationException */ public function testImportXMLUuidRemoveParentWorkspace() { self::$staticSharedFixture['ie']->import('11_Import/idnode'); $session = $this->renewSession(); - $session->getWorkspace()->importXML('/container/idExample', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); + $session->getWorkspace()->importXML('/container/idExample', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); } public function testImportXMLUuidNewSession() @@ -129,7 +140,7 @@ public function testImportXMLUuidNewWorkspace() } private function doTestImportXMLUuidNew($connect, $session) { - $connect->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_CREATE_NEW); + $connect->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_CREATE_NEW); // existing node did not change its uuid $this->assertTrue($session->nodeExists('/container/idExample')); @@ -190,7 +201,7 @@ public function testImportXMLUuidRemoveExistingWorkspace() private function doTestImportXMLUuidRemoveExisting($connect, $session) { - $connect->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); + $connect->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); // existing node removed $this->assertFalse($session->nodeExists('/container/idExample')); @@ -241,7 +252,7 @@ public function testImportXMLUuidReplaceExistingWorkspace() } private function doTestImportXMLUuidReplaceExisting($connect, $session) { - $session->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REPLACE_EXISTING); + $session->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REPLACE_EXISTING); // existing node replaced $this->assertTrue($session->nodeExists('/container/idExample')); @@ -290,7 +301,7 @@ public function testImportXMLUuidReplaceRoot() $this->assertTrue(\PHPCR\Util\UUIDHelper::isUUID($id)); $filename = tempnam('/tmp', ''); $file = fopen($filename, 'w+'); - fwrite($file, str_replace('XXX_ROOT_ID_XXX', $id, file_get_contents(__DIR__.'/../../fixtures/11_Import/rootnode.xml'))); + fwrite($file, str_replace('XXX_ROOT_ID_XXX', $id, file_get_contents(__DIR__ . '/../../fixtures/11_Import/rootnode.xml'))); fclose($file); $session->importXML('/', $filename, ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REPLACE_EXISTING); @@ -310,7 +321,7 @@ public function testImportXMLUuidReplaceRoot() } /** - * Provoke an io error + * Provoke an io error. * * @expectedException \RuntimeException */ @@ -333,7 +344,7 @@ public function testImportXMLDocument() self::$staticSharedFixture['ie']->import('11_Import/idnode'); $session = $this->renewSession(); - $session->importXML('/', __DIR__.'/../../fixtures/11_Import/documentview.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_CREATE_NEW); + $session->importXML('/', __DIR__ . '/../../fixtures/11_Import/documentview.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_CREATE_NEW); // existing node did not change its uuid $this->assertTrue($session->nodeExists('/container/idExample')); @@ -373,7 +384,7 @@ public function testImportXMLDocumentSimple() self::$staticSharedFixture['ie']->import('11_Import/empty'); $session = $this->renewSession(); - $session->importXML('/', __DIR__.'/../../fixtures/11_Import/simple.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $session->importXML('/', __DIR__ . '/../../fixtures/11_Import/simple.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); $this->assertTrue($session->nodeExists('/data/node')); $this->assertTrue($session->nodeExists('/data/sibling/child1')); diff --git a/tests/12_Observation/ObservationManagerTest.php b/tests/12_Observation/ObservationManagerTest.php index df13408d..466d6ec5 100644 --- a/tests/12_Observation/ObservationManagerTest.php +++ b/tests/12_Observation/ObservationManagerTest.php @@ -1,5 +1,14 @@ node to avoid confusion as we run several parallel sessions. + * * @var string */ private $nodePath; @@ -41,7 +50,7 @@ public function setUp() { parent::setUp(); //all tests in this suite rely on the trick to have the node populated from the fixtures - $this->assertInstanceOf('PHPCR\NodeInterface', $this->node, "Something went wrong with fixture loading"); + $this->assertInstanceOf('PHPCR\NodeInterface', $this->node, 'Something went wrong with fixture loading'); $this->nodePath = $this->node->getPath(); $this->node = null; } @@ -157,17 +166,16 @@ public function testUserData() $userDataValues = array( "somedifferent\" data\nnext line ä<>;&:,'x\txx", null, - "" + '', ); $expectedUserDataValues = array( "somedifferent\" data\nnext line ä<>;&:,'x\txx", null, - null + null, ); foreach ($userDataValues as $key => $userData) { - sleep(1); // To avoid having the same date as journal entries generated by previous tests $curTime = time() * 1000; @@ -263,7 +271,7 @@ protected function assertFilterOnNodeTypeNoMatch(ObservationManagerInterface $ob } /** - * Produce the following entries at the end of the event journal: + * Produce the following entries at the end of the event journal:. * * PROPERTY_ADDED /child/jcr:primaryType * NODE_ADDED /child @@ -319,7 +327,7 @@ protected function produceEvents(SessionInterface $session) } /** - * Check that the journal only contains the given events (in any order) + * Check that the journal only contains the given events (in any order). * * Algorithm: * - construct an array of hash for the expected events @@ -342,9 +350,8 @@ protected function expectEventsInAnyOrder(EventJournalInterface $journal, $event // Construct an hash map with the expected events $expectedEvents = array(); foreach ($events as $event) { - if (!is_array($event) || count($event) !== 2) { - throw new \InvalidArgumentException("Invalid expected events array !"); + throw new \InvalidArgumentException('Invalid expected events array !'); } // Construct an hash based on the event type and path $hash = sprintf('%s-%s', md5($event[0]), md5($event[1])); @@ -367,7 +374,7 @@ protected function expectEventsInAnyOrder(EventJournalInterface $journal, $event if (array_key_exists($hash, $expectedEvents)) { unset($expectedEvents[$hash]); } else { - $this->Fail(sprintf("Unexpected event found, type = %s, path = %s, hash = %s", $event->getType(), $event->getPath(), $hash)); + $this->Fail(sprintf('Unexpected event found, type = %s, path = %s, hash = %s', $event->getType(), $event->getPath(), $hash)); } } @@ -482,7 +489,7 @@ protected function assertEvent($expectedType, $expectedPath, EventInterface $eve } /** - * Assert events in the journal have the expected userdata + * Assert events in the journal have the expected userdata. * * @param EventJournalInterface $journal * @param int $startDate unix timestamp @@ -502,7 +509,7 @@ protected function expectEventsWithUserData(EventJournalInterface $journal, $sta } /** - * Internal function used to dump the events in the journal for debugging + * Internal function used to dump the events in the journal for debugging. * * @param $journal */ @@ -511,7 +518,7 @@ protected function varDumpJournal(EventJournalInterface $journal) echo "JOURNAL DUMP:\n"; while ($journal->valid()) { $event = $journal->current(); - echo sprintf("%s - %s - %s\n", $event->getDate(), $event->getType(), $event->getPath()) ; + echo sprintf("%s - %s - %s\n", $event->getDate(), $event->getType(), $event->getPath()); $journal->next(); } } diff --git a/tests/13_WorkspaceManagement/WorkspaceManagementTest.php b/tests/13_WorkspaceManagement/WorkspaceManagementTest.php index 029543bd..2f80ad69 100644 --- a/tests/13_WorkspaceManagement/WorkspaceManagementTest.php +++ b/tests/13_WorkspaceManagement/WorkspaceManagementTest.php @@ -1,6 +1,15 @@ node = $this->session->getNode('/tests_version_base/versionable'); $this->assertContains('mix:versionable', $mixins, 'Node does not have mix:versionable mixin'); - $this->assertTrue( $this->node->getProperty('jcr:isCheckedOut')->getBoolean(),'jcr:isCheckout is not true'); + $this->assertTrue($this->node->getProperty('jcr:isCheckedOut')->getBoolean(), 'jcr:isCheckout is not true'); } public function testNewVersionableNode() diff --git a/tests/15_Versioning/NodeTypeReadTest.php b/tests/15_Versioning/NodeTypeReadTest.php index b7570bb8..32855405 100644 --- a/tests/15_Versioning/NodeTypeReadTest.php +++ b/tests/15_Versioning/NodeTypeReadTest.php @@ -1,9 +1,18 @@ assertInstanceOf('PHPCR\Version\VersionInterface', $firstVersion); $frozen2 = $firstVersion->getFrozenNode(); $this->assertInstanceOf('PHPCR\NodeInterface', $firstVersion); - /** @var $frozen2 NodeInterface */ + /* @var $frozen2 NodeInterface */ $this->assertTrue($frozen2->hasProperty('foo')); $this->assertEquals('bar2', $frozen2->getPropertyValue('foo')); } @@ -119,7 +128,7 @@ public function testGetSuccessors() } /** - * Check $version->remove() is not possible. This must go through VersionHistory::remove + * Check $version->remove() is not possible. This must go through VersionHistory::remove. * * @expectedException \PHPCR\RepositoryException */ diff --git a/tests/15_Versioning/VersionHistoryTest.php b/tests/15_Versioning/VersionHistoryTest.php index c017d0e7..3059234d 100644 --- a/tests/15_Versioning/VersionHistoryTest.php +++ b/tests/15_Versioning/VersionHistoryTest.php @@ -1,13 +1,22 @@ vm->getBaseVersion('/tests_version_base/versioned')->getFrozenNode(); $this->assertSame($currentNode, $lastNode); - } public function testGetAllFrozenNodes() { @@ -244,7 +252,7 @@ public function testGetVersionableIdentifier() } /** - * Create two versions then delete the first version + * Create two versions then delete the first version. * * Note that you can not use $version->remove() although version is a node. */ @@ -279,7 +287,7 @@ public function testDeleteVersion() } /** - * Check the last version cannot be removed + * Check the last version cannot be removed. * * @expectedException \PHPCR\ReferentialIntegrityException */ @@ -291,7 +299,7 @@ public function testDeleteLatestVersion() } /** - * Try removing an unexisting version + * Try removing an unexisting version. * * @expectedException \PHPCR\Version\VersionException */ @@ -303,12 +311,12 @@ public function testDeleteUnexistingVersion() } /** - * Check if a version node with the given name exists in the version history + * Check if a version node with the given name exists in the version history. * * @param VersionHistoryInterface $history The version history node * @param string $versionName The name of the version to search for * - * @return boolean + * @return bool */ protected function versionExists($history, $versionName) { diff --git a/tests/15_Versioning/VersionManagerTest.php b/tests/15_Versioning/VersionManagerTest.php index 7ccd7a7c..05e345d7 100644 --- a/tests/15_Versioning/VersionManagerTest.php +++ b/tests/15_Versioning/VersionManagerTest.php @@ -1,9 +1,18 @@ setExpectedException('PHPCR\Version\VersionException'); $node->setProperty('foo', 'bar2'); $this->session->save(); - } /** @@ -324,5 +332,4 @@ public function testRestoreRootVersion() } // TODO: cancelMerge, merge, doneMerge, createConfiguration, createActivity, setActivity, getActivity, removeActivity, restoreByLabel - } diff --git a/tests/15_Versioning/VersionTest.php b/tests/15_Versioning/VersionTest.php index 7877fd6a..ba9fedc1 100644 --- a/tests/15_Versioning/VersionTest.php +++ b/tests/15_Versioning/VersionTest.php @@ -1,13 +1,22 @@ assertInstanceOf('PHPCR\Version\VersionInterface', $firstVersion); $frozen2 = $firstVersion->getFrozenNode(); $this->assertInstanceOf('PHPCR\NodeInterface', $firstVersion); - /** @var $frozen2 NodeInterface */ + /* @var $frozen2 NodeInterface */ $this->assertTrue($frozen2->hasProperty('foo')); $this->assertEquals('bar2', $frozen2->getPropertyValue('foo')); } @@ -134,7 +143,7 @@ public function testGetSuccessors() } /** - * Check $version->remove() is not possible. This must go through VersionHistory::remove + * Check $version->remove() is not possible. This must go through VersionHistory::remove. * * @expectedException \PHPCR\RepositoryException */ diff --git a/tests/17_Locking/LockManagerTest.php b/tests/17_Locking/LockManagerTest.php index 749c4270..b1dd982c 100644 --- a/tests/17_Locking/LockManagerTest.php +++ b/tests/17_Locking/LockManagerTest.php @@ -1,9 +1,18 @@ recreateTestNode('non-lockable', false); - $this->lm->lock('/non-lockable', true, true, 3, ""); + $this->lm->lock('/non-lockable', true, true, 3, ''); } /** - * Try to lock an already locked node + * Try to lock an already locked node. + * * @expectedException \PHPCR\Lock\LockException */ public function testLockAlreadyLocked() @@ -43,18 +54,19 @@ public function testLockAlreadyLocked() // The first lock should work try { - $this->lm->lock('/lockable-node', true, true, 3, ""); + $this->lm->lock('/lockable-node', true, true, 3, ''); } catch (\PHPCR\Lock\LockException $ex) { // The lock didn't work, Huston, there is a problem... $this->fail('An error occurred while trying to lock a valid node: ' . $ex->getMessage()); } // The second lock should not work - $this->lm->lock('/lockable-node', true, true, 3, ""); + $this->lm->lock('/lockable-node', true, true, 3, ''); } /** - * Try to deep lock a node which subtree contains a locked node + * Try to deep lock a node which subtree contains a locked node. + * * @expectedException \PHPCR\Lock\LockException */ public function testLockDeepOnAlreadyLocked() @@ -64,28 +76,30 @@ public function testLockDeepOnAlreadyLocked() // The lock on the child should work try { - $this->lm->lock('/lockable-parent/lockable-child', true, true, 3, ""); + $this->lm->lock('/lockable-parent/lockable-child', true, true, 3, ''); } catch (\PHPCR\Lock\LockException $ex) { $this->fail('An error occurred while trying to lock a valid node: ' . $ex->getMessage()); } // The *deep* lock on the parent should not work - $this->lm->lock('/lockable-parent', true, true, 3, ""); + $this->lm->lock('/lockable-parent', true, true, 3, ''); } /** * Try to lock a node with non-saved pending changes. + * * @expectedException \PHPCR\InvalidItemStateException */ public function testLockNonSavedNode() { $node = $this->recreateTestNode('unsaved', true); $node->setProperty('testprop', 'foobar'); - $this->lm->lock('/unsaved', true, true, 3, ""); + $this->lm->lock('/unsaved', true, true, 3, ''); } /** - * Try to lock an unexisting node + * Try to lock an unexisting node. + * * @expectedException \PHPCR\PathNotFoundException */ public function testLockNonExistingNode() @@ -94,7 +108,7 @@ public function testLockNonExistingNode() } /** - * Test a simple lock on a lockable node + * Test a simple lock on a lockable node. */ public function testCanLockLockableNodes() { @@ -142,7 +156,7 @@ public function testCanLockLockableNodeInfiniteTimeout() } /** - * Check that a deep lock locks the children but still the lock is hold by the parent node + * Check that a deep lock locks the children but still the lock is hold by the parent node. */ public function testDeepLock() { @@ -155,7 +169,7 @@ public function testDeepLock() } /** - * Check deep lock with the LockInfo + * Check deep lock with the LockInfo. */ public function testDeepLockInfo() { @@ -182,7 +196,7 @@ private function assertDeepLock() } /** - * Check that a non-deep lock does not lock the children + * Check that a non-deep lock does not lock the children. */ public function testNonDeepLock() { @@ -201,7 +215,7 @@ public function testNonDeepLock() } /** - * Test a simple lock on a lockable node + * Test a simple lock on a lockable node. */ public function testLockOwner() { @@ -214,7 +228,8 @@ public function testLockOwner() // ----- ISLOCKED TESTS --------------------------------------------------- /** - * Check a locked node is locked + * Check a locked node is locked. + * * @depends testCanLockLockableNodeInfiniteTimeout */ public function testIsLockedOnLocked() @@ -223,7 +238,8 @@ public function testIsLockedOnLocked() } /** - * Check an unlocked node is not locked + * Check an unlocked node is not locked. + * * @depends testCannotLockNonLockableNodes */ public function testIsLockedOnUnlocked() @@ -234,7 +250,8 @@ public function testIsLockedOnUnlocked() // ----- HOLDSLOCK TESTS -------------------------------------------------- /** - * Try to test the lock on an unexisting node + * Try to test the lock on an unexisting node. + * * @expectedException \PHPCR\PathNotFoundException */ public function testHoldsLockUnexistingNode() @@ -261,7 +278,8 @@ public function testHoldsLockOnLocked() // ----- UNLOCK TESTS ----------------------------------------------------- /** - * Try to unlock a locked node + * Try to unlock a locked node. + * * @depends testCanLockLockableNodeInfiniteTimeout */ public function testUnlockOnLocked() @@ -272,7 +290,8 @@ public function testUnlockOnLocked() } /** - * Try to unlock a non-lockable node + * Try to unlock a non-lockable node. + * * @depends testIsLockedOnUnlocked * @expectedException \PHPCR\Lock\LockException */ @@ -282,19 +301,21 @@ public function testUnlockOnNonLocked() } /** - * Try to unlock a unsaved node + * Try to unlock a unsaved node. + * * @expectedException \PHPCR\InvalidItemStateException */ public function testUnlockInvalidState() { $node = $this->recreateTestNode('locked-unsaved', true); - $this->lm->lock('/locked-unsaved', true, true, 3, ""); + $this->lm->lock('/locked-unsaved', true, true, 3, ''); $node->setProperty('testprop', 'foobar'); $this->lm->unlock('/locked-unsaved'); } /** - * Try to unlock an unexisting node + * Try to unlock an unexisting node. + * * @expectedException \PHPCR\PathNotFoundException */ public function testUnlockUnexistingNode() @@ -302,16 +323,16 @@ public function testUnlockUnexistingNode() $this->lm->unlock('/some-unexisting-node'); } - // ----- HELPERS ---------------------------------------------------------- /** - * Helper function to simplify the test of valid Lock objects + * Helper function to simplify the test of valid Lock objects. + * * @param \PHPCR\Lock\LockInterface $lock The lock to check * @param NodeInterface the expected node of this lock * @param string $expectedOwner - * @param boolean $expectedIsDeep - * @param boolean $expectedIsSessionScoped + * @param bool $expectedIsDeep + * @param bool $expectedIsSessionScoped * @param int $timeout the expected seconds remaining. One second less remaining is accepted too to permit for one second change */ protected function assertLockEquals($lock, $expectedNode, $expectedOwner, $expectedIsDeep, $expectedIsSessionScoped, $timeout) @@ -361,5 +382,4 @@ protected function recreateTestNode($relPath, $lockable = true, $session = null) return $node; } - } diff --git a/tests/19_NodeTypeManagement/CndTest.php b/tests/19_NodeTypeManagement/CndTest.php index cb4be5a9..78bc0d27 100644 --- a/tests/19_NodeTypeManagement/CndTest.php +++ b/tests/19_NodeTypeManagement/CndTest.php @@ -1,10 +1,19 @@ assertEquals('phpcr:apitest', $name); $this->assertInstanceOf('PHPCR\NodeType\NodeTypeDefinitionInterface', $type); - /** @var $type NodeTypeDefinitionInterface */ + /* @var $type NodeTypeDefinitionInterface */ $props = $type->getDeclaredPropertyDefinitions(); $this->assertCount(1, $props, 'Wrong number of properties in phpcr:apitest'); $this->assertEquals('phpcr:class', $props[0]->getName()); @@ -97,7 +105,7 @@ protected function assertTypes($types) list($name, $type) = each($types); $this->assertEquals('phpcr:test', $name); $this->assertInstanceOf('PHPCR\NodeType\NodeTypeDefinitionInterface', $type); - /** @var $type NodeTypeDefinitionInterface */ + /* @var $type NodeTypeDefinitionInterface */ $props = $type->getDeclaredPropertyDefinitions(); $this->assertCount(1, $props, 'Wrong number of properties in phpcr:test'); $this->assertEquals('phpcr:prop', $props[0]->getName()); @@ -157,7 +165,7 @@ public function testPrimaryItem() } $node = $root->addNode('test_node', 'phpcr:primary_item_test'); - $node->setProperty("phpcr:content", 'test'); + $node->setProperty('phpcr:content', 'test'); $this->session->save(); // Check the primary item of the new node diff --git a/tests/19_NodeTypeManagement/NodeTypeTest.php b/tests/19_NodeTypeManagement/NodeTypeTest.php index daaa373c..767a2a49 100644 --- a/tests/19_NodeTypeManagement/NodeTypeTest.php +++ b/tests/19_NodeTypeManagement/NodeTypeTest.php @@ -1,11 +1,20 @@ renewSession(); parent::setUp(); - $this->assertInstanceOf('PHPCR\NodeInterface', $this->node, "Something went wrong with fixture loading"); + $this->assertInstanceOf('PHPCR\NodeInterface', $this->node, 'Something went wrong with fixture loading'); } public function testGetTransactionManager() @@ -54,7 +61,7 @@ public function testTransactionCommit() public function testTransactionRollback() { $copy = $this->node->addNode('copyTransaction'); - $copiedNodePath = $this->node->getPath()."/copyTransactionCopy"; + $copiedNodePath = $this->node->getPath() . '/copyTransactionCopy'; $this->session->save(); $utx = $this->session->getWorkspace()->getTransactionManager(); @@ -62,7 +69,7 @@ public function testTransactionRollback() $child = $this->node->addNode('insideTransaction'); $utx->begin(); //workspace operation - $this->session->getWorkspace()->copy($copy->getPath(),$copiedNodePath); + $this->session->getWorkspace()->copy($copy->getPath(), $copiedNodePath); $this->session->save(); $this->assertFalse($child->isNew()); $utx->rollback(); @@ -84,7 +91,7 @@ public function testTransactionRollback() public function testInTransaction() { - $utx= $this->session->getWorkspace()->getTransactionManager(); + $utx = $this->session->getWorkspace()->getTransactionManager(); $this->assertFalse($utx->inTransaction()); $utx->begin(); @@ -103,7 +110,7 @@ public function testInTransaction() } /** - * Testing interaction of transactions and versioning + * Testing interaction of transactions and versioning. * * @expectedException \PHPCR\InvalidItemStateException */ @@ -113,7 +120,7 @@ public function testIllegalCheckin() $vm = $this->session->getWorkspace()->getVersionManager(); - $utx= $this->session->getWorkspace()->getTransactionManager(); + $utx = $this->session->getWorkspace()->getTransactionManager(); $vm->checkout($this->node->getPath()); $this->node->setProperty('foo', 'bar2'); @@ -127,5 +134,4 @@ public function testTransactionTimeout() { $this->markTestIncomplete('This test has not been implemented yet.'); } - } diff --git a/tests/22_SameNameSiblings/DeleteMethodsTest.php b/tests/22_SameNameSiblings/DeleteMethodsTest.php index 7a7cf303..f4118f1a 100644 --- a/tests/22_SameNameSiblings/DeleteMethodsTest.php +++ b/tests/22_SameNameSiblings/DeleteMethodsTest.php @@ -1,6 +1,15 @@ removeItem() with multiple items before session->save() + * Call session->removeItem() with multiple items before session->save(). */ public function testRemoveItemMultiple() { @@ -45,7 +54,7 @@ public function testRemoveItemMultiple() } /** - * Call node->remove() with multiple items before session->save() + * Call node->remove() with multiple items before session->save(). * * \PHPCR\ItemInterface::remove */ @@ -135,6 +144,7 @@ public function testDeleteManyNodes() /** * @param $session * @param $parentPath + * * @return mixed */ private function getParentNode($session, $parentPath) diff --git a/tests/23_OrderableChildNodes/OrderBeforeTest.php b/tests/23_OrderableChildNodes/OrderBeforeTest.php index 34ac8e98..4ebac69d 100644 --- a/tests/23_OrderableChildNodes/OrderBeforeTest.php +++ b/tests/23_OrderableChildNodes/OrderBeforeTest.php @@ -1,13 +1,21 @@ cndParser->parseFile(__DIR__ . '/resources/cnd/example.compact.cnd'); $this->assertExampleCnd($res); - } public function testParseVerbose() @@ -63,7 +69,7 @@ public function testParseString() } /** - * Have invalid-string in the middle of options for a property + * Have invalid-string in the middle of options for a property. * * @expectedException \PHPCR\Util\CND\Exception\ParserException */ @@ -111,7 +117,7 @@ public function testScannerErrorComment() } /** - * Have a newline in a name (here the ns declaration) + * Have a newline in a name (here the ns declaration). * * @expectedException \PHPCR\Util\CND\Exception\ScannerException */ @@ -207,5 +213,4 @@ protected function assertExampleCnd($res) $this->assertTrue($prop->isFullTextSearchable()); // True because there was no "nofulltext" attribute $this->assertTrue($prop->isQueryOrderable()); // True because there was no "noqueryorder" attribute } - } diff --git a/tests/PhpcrUtils/CndWriterTest.php b/tests/PhpcrUtils/CndWriterTest.php index 77e904aa..f6a27aef 100644 --- a/tests/PhpcrUtils/CndWriterTest.php +++ b/tests/PhpcrUtils/CndWriterTest.php @@ -1,11 +1,18 @@ expects($this->any()) ->method('getUri') ->will($this->returnCallback( - function($prefix) { + function ($prefix) { switch ($prefix) { case 'ns': return 'http://namespace.com/ns'; @@ -92,4 +99,5 @@ function($prefix) { } abstract class MockNamespaceRegistry implements \Iterator, NamespaceRegistryInterface -{} +{ +} diff --git a/tests/PhpcrUtils/PurgeTest.php b/tests/PhpcrUtils/PurgeTest.php index 1b07a214..362f828d 100644 --- a/tests/PhpcrUtils/PurgeTest.php +++ b/tests/PhpcrUtils/PurgeTest.php @@ -1,11 +1,18 @@ markTestSkipped('This testbed does not have phpcr-utils available'); } parent::setUp(); From c5ea595804fbe728ea355b5514cf18de28c0004d Mon Sep 17 00:00:00 2001 From: dantleech Date: Sat, 27 Jun 2015 17:59:31 +0200 Subject: [PATCH 4/7] Removed numerical prefix --- composer.json | 4 ++-- tests/{14_ShareableNodes => AccessControlManagement}/TODO | 0 .../RepositoryDescriptorsTest.php | 0 tests/{04_Connecting => Connecting}/RepositoryFactoryTest.php | 0 tests/{04_Connecting => Connecting}/RepositoryTest.php | 0 .../{04_Connecting => Connecting}/SessionReadMethodsTest.php | 0 tests/{04_Connecting => Connecting}/SimpleCredentialsTest.php | 0 .../WorkspaceReadMethodsTest.php | 0 tests/{07_Export => Export}/ExportRepositoryContentTest.php | 0 tests/{11_Import => Import}/ImportRepositoryContentTest.php | 0 .../{16_AccessControlManagement => LifecycleManagement}/TODO | 0 tests/{17_Locking => Locking}/LockManagerTest.php | 0 .../NodeDefinitionTest.php | 0 .../NodeNodeTypeReadMethodsTest.php | 0 .../NodeTypeDiscoveryTest.php | 0 .../NodeTypeTest.php | 0 .../PropertyDefinitionTest.php | 0 tests/{08_NodeTypeDiscovery => NodeTypeDiscovery}/TODO | 0 .../{19_NodeTypeManagement => NodeTypeManagement}/CndTest.php | 0 .../NodeTypeBaseCase.php | 0 .../NodeTypeTest.php | 0 .../ObservationManagerTest.php | 0 .../OrderBeforeTest.php | 0 .../PermissionReadTest.php | 0 tests/{06_Query => Query}/CharacterTest.php | 0 tests/{06_Query => Query}/NodeViewTest.php | 0 .../QOM/ConvertQueriesBackAndForthTest.php | 0 tests/{06_Query => Query}/QOM/QomTestQueries.php | 0 tests/{06_Query => Query}/QOM/QomToSql2ConverterTest.php | 0 tests/{06_Query => Query}/QOM/Sql2ScannerTest.php | 0 tests/{06_Query => Query}/QOM/Sql2TestQueries.php | 0 tests/{06_Query => Query}/QOM/Sql2ToQomConverterTest.php | 0 tests/{06_Query => Query}/QueryBaseCase.php | 0 tests/{06_Query => Query}/QueryManagerTest.php | 0 tests/{06_Query => Query}/QueryObjectQOMTest.php | 0 tests/{06_Query => Query}/QueryObjectSql2Test.php | 0 tests/{06_Query => Query}/QueryResultsTest.php | 0 tests/{06_Query => Query}/QuerySql2OperationsTest.php | 0 tests/{06_Query => Query}/RowIteratorTest.php | 0 tests/{06_Query => Query}/RowTest.php | 0 tests/{06_Query => Query}/Sql1/QueryBaseCase.php | 0 tests/{06_Query => Query}/Sql1/QueryOperationsTest.php | 0 tests/{06_Query => Query}/XPath/QueryBaseCase.php | 0 tests/{06_Query => Query}/XPath/QueryOperationsTest.php | 0 tests/{05_Reading => Reading}/BinaryReadMethodsTest.php | 0 tests/{05_Reading => Reading}/EncodingTest.php | 0 tests/{05_Reading => Reading}/JackalopeFetchDepthTest.php | 0 tests/{05_Reading => Reading}/NodeReadMethodsTest.php | 0 tests/{05_Reading => Reading}/PropertyReadMethodsTest.php | 0 .../{05_Reading => Reading}/SessionNamespaceRemappingTest.php | 0 tests/{05_Reading => Reading}/SessionReadMethodsTest.php | 0 tests/{18_LifecycleManagement => RetentionAndHold}/TODO | 0 .../DeleteMethodsTest.php | 0 tests/{22_SameNameSiblings => SameNameSiblings}/TODO | 0 tests/{20_RetentionAndHold => ShareableNodes}/TODO | 0 .../TransactionMethodsTest.php | 0 .../CreateVersionableNodeTest.php | 0 tests/{15_Versioning => Versioning}/NodeTypeReadTest.php | 0 tests/{15_Versioning => Versioning}/SimpleVersionTest.php | 0 tests/{15_Versioning => Versioning}/VersionHistoryTest.php | 0 tests/{15_Versioning => Versioning}/VersionManagerTest.php | 0 tests/{15_Versioning => Versioning}/VersionTest.php | 0 .../WorkspaceManagementTest.php | 0 tests/{10_Writing => Writing}/AddMethodsTest.php | 0 tests/{10_Writing => Writing}/CloneMethodsTest.php | 0 tests/{10_Writing => Writing}/CombinedManipulationsTest.php | 0 tests/{10_Writing => Writing}/CopyMethodsTest.php | 0 tests/{10_Writing => Writing}/DeleteMethodsTest.php | 0 tests/{10_Writing => Writing}/EncodingTest.php | 0 tests/{10_Writing => Writing}/ItemStateTest.php | 0 tests/{10_Writing => Writing}/LastModifiedTest.php | 0 tests/{10_Writing => Writing}/LastModifiedUpdateTest.php | 0 tests/{10_Writing => Writing}/MixinCreatedTest.php | 0 tests/{10_Writing => Writing}/MixinReferenceableTest.php | 0 tests/{10_Writing => Writing}/MoveMethodsTest.php | 0 tests/{10_Writing => Writing}/NamespaceRegistryTest.php | 0 tests/{10_Writing => Writing}/NodeTypeAssignementTest.php | 0 .../NodeTypePreemptiveValidationTest.php | 0 .../SetPropertyDynamicRebindingTest.php | 0 tests/{10_Writing => Writing}/SetPropertyMethodsTest.php | 0 tests/{10_Writing => Writing}/SetPropertyTypesTest.php | 0 81 files changed, 2 insertions(+), 2 deletions(-) rename tests/{14_ShareableNodes => AccessControlManagement}/TODO (100%) rename tests/{04_Connecting => Connecting}/RepositoryDescriptorsTest.php (100%) rename tests/{04_Connecting => Connecting}/RepositoryFactoryTest.php (100%) rename tests/{04_Connecting => Connecting}/RepositoryTest.php (100%) rename tests/{04_Connecting => Connecting}/SessionReadMethodsTest.php (100%) rename tests/{04_Connecting => Connecting}/SimpleCredentialsTest.php (100%) rename tests/{04_Connecting => Connecting}/WorkspaceReadMethodsTest.php (100%) rename tests/{07_Export => Export}/ExportRepositoryContentTest.php (100%) rename tests/{11_Import => Import}/ImportRepositoryContentTest.php (100%) rename tests/{16_AccessControlManagement => LifecycleManagement}/TODO (100%) rename tests/{17_Locking => Locking}/LockManagerTest.php (100%) rename tests/{08_NodeTypeDiscovery => NodeTypeDiscovery}/NodeDefinitionTest.php (100%) rename tests/{08_NodeTypeDiscovery => NodeTypeDiscovery}/NodeNodeTypeReadMethodsTest.php (100%) rename tests/{08_NodeTypeDiscovery => NodeTypeDiscovery}/NodeTypeDiscoveryTest.php (100%) rename tests/{08_NodeTypeDiscovery => NodeTypeDiscovery}/NodeTypeTest.php (100%) rename tests/{08_NodeTypeDiscovery => NodeTypeDiscovery}/PropertyDefinitionTest.php (100%) rename tests/{08_NodeTypeDiscovery => NodeTypeDiscovery}/TODO (100%) rename tests/{19_NodeTypeManagement => NodeTypeManagement}/CndTest.php (100%) rename tests/{19_NodeTypeManagement => NodeTypeManagement}/NodeTypeBaseCase.php (100%) rename tests/{19_NodeTypeManagement => NodeTypeManagement}/NodeTypeTest.php (100%) rename tests/{12_Observation => Observation}/ObservationManagerTest.php (100%) rename tests/{23_OrderableChildNodes => OrderableChildNodes}/OrderBeforeTest.php (100%) rename tests/{09_PermissionsAndCapabilities => PermissionsAndCapabilities}/PermissionReadTest.php (100%) rename tests/{06_Query => Query}/CharacterTest.php (100%) rename tests/{06_Query => Query}/NodeViewTest.php (100%) rename tests/{06_Query => Query}/QOM/ConvertQueriesBackAndForthTest.php (100%) rename tests/{06_Query => Query}/QOM/QomTestQueries.php (100%) rename tests/{06_Query => Query}/QOM/QomToSql2ConverterTest.php (100%) rename tests/{06_Query => Query}/QOM/Sql2ScannerTest.php (100%) rename tests/{06_Query => Query}/QOM/Sql2TestQueries.php (100%) rename tests/{06_Query => Query}/QOM/Sql2ToQomConverterTest.php (100%) rename tests/{06_Query => Query}/QueryBaseCase.php (100%) rename tests/{06_Query => Query}/QueryManagerTest.php (100%) rename tests/{06_Query => Query}/QueryObjectQOMTest.php (100%) rename tests/{06_Query => Query}/QueryObjectSql2Test.php (100%) rename tests/{06_Query => Query}/QueryResultsTest.php (100%) rename tests/{06_Query => Query}/QuerySql2OperationsTest.php (100%) rename tests/{06_Query => Query}/RowIteratorTest.php (100%) rename tests/{06_Query => Query}/RowTest.php (100%) rename tests/{06_Query => Query}/Sql1/QueryBaseCase.php (100%) rename tests/{06_Query => Query}/Sql1/QueryOperationsTest.php (100%) rename tests/{06_Query => Query}/XPath/QueryBaseCase.php (100%) rename tests/{06_Query => Query}/XPath/QueryOperationsTest.php (100%) rename tests/{05_Reading => Reading}/BinaryReadMethodsTest.php (100%) rename tests/{05_Reading => Reading}/EncodingTest.php (100%) rename tests/{05_Reading => Reading}/JackalopeFetchDepthTest.php (100%) rename tests/{05_Reading => Reading}/NodeReadMethodsTest.php (100%) rename tests/{05_Reading => Reading}/PropertyReadMethodsTest.php (100%) rename tests/{05_Reading => Reading}/SessionNamespaceRemappingTest.php (100%) rename tests/{05_Reading => Reading}/SessionReadMethodsTest.php (100%) rename tests/{18_LifecycleManagement => RetentionAndHold}/TODO (100%) rename tests/{22_SameNameSiblings => SameNameSiblings}/DeleteMethodsTest.php (100%) rename tests/{22_SameNameSiblings => SameNameSiblings}/TODO (100%) rename tests/{20_RetentionAndHold => ShareableNodes}/TODO (100%) rename tests/{21_Transactions => Transactions}/TransactionMethodsTest.php (100%) rename tests/{15_Versioning => Versioning}/CreateVersionableNodeTest.php (100%) rename tests/{15_Versioning => Versioning}/NodeTypeReadTest.php (100%) rename tests/{15_Versioning => Versioning}/SimpleVersionTest.php (100%) rename tests/{15_Versioning => Versioning}/VersionHistoryTest.php (100%) rename tests/{15_Versioning => Versioning}/VersionManagerTest.php (100%) rename tests/{15_Versioning => Versioning}/VersionTest.php (100%) rename tests/{13_WorkspaceManagement => WorkspaceManagement}/WorkspaceManagementTest.php (100%) rename tests/{10_Writing => Writing}/AddMethodsTest.php (100%) rename tests/{10_Writing => Writing}/CloneMethodsTest.php (100%) rename tests/{10_Writing => Writing}/CombinedManipulationsTest.php (100%) rename tests/{10_Writing => Writing}/CopyMethodsTest.php (100%) rename tests/{10_Writing => Writing}/DeleteMethodsTest.php (100%) rename tests/{10_Writing => Writing}/EncodingTest.php (100%) rename tests/{10_Writing => Writing}/ItemStateTest.php (100%) rename tests/{10_Writing => Writing}/LastModifiedTest.php (100%) rename tests/{10_Writing => Writing}/LastModifiedUpdateTest.php (100%) rename tests/{10_Writing => Writing}/MixinCreatedTest.php (100%) rename tests/{10_Writing => Writing}/MixinReferenceableTest.php (100%) rename tests/{10_Writing => Writing}/MoveMethodsTest.php (100%) rename tests/{10_Writing => Writing}/NamespaceRegistryTest.php (100%) rename tests/{10_Writing => Writing}/NodeTypeAssignementTest.php (100%) rename tests/{10_Writing => Writing}/NodeTypePreemptiveValidationTest.php (100%) rename tests/{10_Writing => Writing}/SetPropertyDynamicRebindingTest.php (100%) rename tests/{10_Writing => Writing}/SetPropertyMethodsTest.php (100%) rename tests/{10_Writing => Writing}/SetPropertyTypesTest.php (100%) diff --git a/composer.json b/composer.json index 01304001..a5184683 100644 --- a/composer.json +++ b/composer.json @@ -32,8 +32,8 @@ }, "autoload": { "psr-4": { - "PHPCR\\Test\\": "lib", - "PHPCR\\Tests\\": "tests" + "PHPCR\\Test\\": "lib/", + "PHPCR\\Tests\\": "tests/" } }, "extra": { diff --git a/tests/14_ShareableNodes/TODO b/tests/AccessControlManagement/TODO similarity index 100% rename from tests/14_ShareableNodes/TODO rename to tests/AccessControlManagement/TODO diff --git a/tests/04_Connecting/RepositoryDescriptorsTest.php b/tests/Connecting/RepositoryDescriptorsTest.php similarity index 100% rename from tests/04_Connecting/RepositoryDescriptorsTest.php rename to tests/Connecting/RepositoryDescriptorsTest.php diff --git a/tests/04_Connecting/RepositoryFactoryTest.php b/tests/Connecting/RepositoryFactoryTest.php similarity index 100% rename from tests/04_Connecting/RepositoryFactoryTest.php rename to tests/Connecting/RepositoryFactoryTest.php diff --git a/tests/04_Connecting/RepositoryTest.php b/tests/Connecting/RepositoryTest.php similarity index 100% rename from tests/04_Connecting/RepositoryTest.php rename to tests/Connecting/RepositoryTest.php diff --git a/tests/04_Connecting/SessionReadMethodsTest.php b/tests/Connecting/SessionReadMethodsTest.php similarity index 100% rename from tests/04_Connecting/SessionReadMethodsTest.php rename to tests/Connecting/SessionReadMethodsTest.php diff --git a/tests/04_Connecting/SimpleCredentialsTest.php b/tests/Connecting/SimpleCredentialsTest.php similarity index 100% rename from tests/04_Connecting/SimpleCredentialsTest.php rename to tests/Connecting/SimpleCredentialsTest.php diff --git a/tests/04_Connecting/WorkspaceReadMethodsTest.php b/tests/Connecting/WorkspaceReadMethodsTest.php similarity index 100% rename from tests/04_Connecting/WorkspaceReadMethodsTest.php rename to tests/Connecting/WorkspaceReadMethodsTest.php diff --git a/tests/07_Export/ExportRepositoryContentTest.php b/tests/Export/ExportRepositoryContentTest.php similarity index 100% rename from tests/07_Export/ExportRepositoryContentTest.php rename to tests/Export/ExportRepositoryContentTest.php diff --git a/tests/11_Import/ImportRepositoryContentTest.php b/tests/Import/ImportRepositoryContentTest.php similarity index 100% rename from tests/11_Import/ImportRepositoryContentTest.php rename to tests/Import/ImportRepositoryContentTest.php diff --git a/tests/16_AccessControlManagement/TODO b/tests/LifecycleManagement/TODO similarity index 100% rename from tests/16_AccessControlManagement/TODO rename to tests/LifecycleManagement/TODO diff --git a/tests/17_Locking/LockManagerTest.php b/tests/Locking/LockManagerTest.php similarity index 100% rename from tests/17_Locking/LockManagerTest.php rename to tests/Locking/LockManagerTest.php diff --git a/tests/08_NodeTypeDiscovery/NodeDefinitionTest.php b/tests/NodeTypeDiscovery/NodeDefinitionTest.php similarity index 100% rename from tests/08_NodeTypeDiscovery/NodeDefinitionTest.php rename to tests/NodeTypeDiscovery/NodeDefinitionTest.php diff --git a/tests/08_NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php b/tests/NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php similarity index 100% rename from tests/08_NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php rename to tests/NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php diff --git a/tests/08_NodeTypeDiscovery/NodeTypeDiscoveryTest.php b/tests/NodeTypeDiscovery/NodeTypeDiscoveryTest.php similarity index 100% rename from tests/08_NodeTypeDiscovery/NodeTypeDiscoveryTest.php rename to tests/NodeTypeDiscovery/NodeTypeDiscoveryTest.php diff --git a/tests/08_NodeTypeDiscovery/NodeTypeTest.php b/tests/NodeTypeDiscovery/NodeTypeTest.php similarity index 100% rename from tests/08_NodeTypeDiscovery/NodeTypeTest.php rename to tests/NodeTypeDiscovery/NodeTypeTest.php diff --git a/tests/08_NodeTypeDiscovery/PropertyDefinitionTest.php b/tests/NodeTypeDiscovery/PropertyDefinitionTest.php similarity index 100% rename from tests/08_NodeTypeDiscovery/PropertyDefinitionTest.php rename to tests/NodeTypeDiscovery/PropertyDefinitionTest.php diff --git a/tests/08_NodeTypeDiscovery/TODO b/tests/NodeTypeDiscovery/TODO similarity index 100% rename from tests/08_NodeTypeDiscovery/TODO rename to tests/NodeTypeDiscovery/TODO diff --git a/tests/19_NodeTypeManagement/CndTest.php b/tests/NodeTypeManagement/CndTest.php similarity index 100% rename from tests/19_NodeTypeManagement/CndTest.php rename to tests/NodeTypeManagement/CndTest.php diff --git a/tests/19_NodeTypeManagement/NodeTypeBaseCase.php b/tests/NodeTypeManagement/NodeTypeBaseCase.php similarity index 100% rename from tests/19_NodeTypeManagement/NodeTypeBaseCase.php rename to tests/NodeTypeManagement/NodeTypeBaseCase.php diff --git a/tests/19_NodeTypeManagement/NodeTypeTest.php b/tests/NodeTypeManagement/NodeTypeTest.php similarity index 100% rename from tests/19_NodeTypeManagement/NodeTypeTest.php rename to tests/NodeTypeManagement/NodeTypeTest.php diff --git a/tests/12_Observation/ObservationManagerTest.php b/tests/Observation/ObservationManagerTest.php similarity index 100% rename from tests/12_Observation/ObservationManagerTest.php rename to tests/Observation/ObservationManagerTest.php diff --git a/tests/23_OrderableChildNodes/OrderBeforeTest.php b/tests/OrderableChildNodes/OrderBeforeTest.php similarity index 100% rename from tests/23_OrderableChildNodes/OrderBeforeTest.php rename to tests/OrderableChildNodes/OrderBeforeTest.php diff --git a/tests/09_PermissionsAndCapabilities/PermissionReadTest.php b/tests/PermissionsAndCapabilities/PermissionReadTest.php similarity index 100% rename from tests/09_PermissionsAndCapabilities/PermissionReadTest.php rename to tests/PermissionsAndCapabilities/PermissionReadTest.php diff --git a/tests/06_Query/CharacterTest.php b/tests/Query/CharacterTest.php similarity index 100% rename from tests/06_Query/CharacterTest.php rename to tests/Query/CharacterTest.php diff --git a/tests/06_Query/NodeViewTest.php b/tests/Query/NodeViewTest.php similarity index 100% rename from tests/06_Query/NodeViewTest.php rename to tests/Query/NodeViewTest.php diff --git a/tests/06_Query/QOM/ConvertQueriesBackAndForthTest.php b/tests/Query/QOM/ConvertQueriesBackAndForthTest.php similarity index 100% rename from tests/06_Query/QOM/ConvertQueriesBackAndForthTest.php rename to tests/Query/QOM/ConvertQueriesBackAndForthTest.php diff --git a/tests/06_Query/QOM/QomTestQueries.php b/tests/Query/QOM/QomTestQueries.php similarity index 100% rename from tests/06_Query/QOM/QomTestQueries.php rename to tests/Query/QOM/QomTestQueries.php diff --git a/tests/06_Query/QOM/QomToSql2ConverterTest.php b/tests/Query/QOM/QomToSql2ConverterTest.php similarity index 100% rename from tests/06_Query/QOM/QomToSql2ConverterTest.php rename to tests/Query/QOM/QomToSql2ConverterTest.php diff --git a/tests/06_Query/QOM/Sql2ScannerTest.php b/tests/Query/QOM/Sql2ScannerTest.php similarity index 100% rename from tests/06_Query/QOM/Sql2ScannerTest.php rename to tests/Query/QOM/Sql2ScannerTest.php diff --git a/tests/06_Query/QOM/Sql2TestQueries.php b/tests/Query/QOM/Sql2TestQueries.php similarity index 100% rename from tests/06_Query/QOM/Sql2TestQueries.php rename to tests/Query/QOM/Sql2TestQueries.php diff --git a/tests/06_Query/QOM/Sql2ToQomConverterTest.php b/tests/Query/QOM/Sql2ToQomConverterTest.php similarity index 100% rename from tests/06_Query/QOM/Sql2ToQomConverterTest.php rename to tests/Query/QOM/Sql2ToQomConverterTest.php diff --git a/tests/06_Query/QueryBaseCase.php b/tests/Query/QueryBaseCase.php similarity index 100% rename from tests/06_Query/QueryBaseCase.php rename to tests/Query/QueryBaseCase.php diff --git a/tests/06_Query/QueryManagerTest.php b/tests/Query/QueryManagerTest.php similarity index 100% rename from tests/06_Query/QueryManagerTest.php rename to tests/Query/QueryManagerTest.php diff --git a/tests/06_Query/QueryObjectQOMTest.php b/tests/Query/QueryObjectQOMTest.php similarity index 100% rename from tests/06_Query/QueryObjectQOMTest.php rename to tests/Query/QueryObjectQOMTest.php diff --git a/tests/06_Query/QueryObjectSql2Test.php b/tests/Query/QueryObjectSql2Test.php similarity index 100% rename from tests/06_Query/QueryObjectSql2Test.php rename to tests/Query/QueryObjectSql2Test.php diff --git a/tests/06_Query/QueryResultsTest.php b/tests/Query/QueryResultsTest.php similarity index 100% rename from tests/06_Query/QueryResultsTest.php rename to tests/Query/QueryResultsTest.php diff --git a/tests/06_Query/QuerySql2OperationsTest.php b/tests/Query/QuerySql2OperationsTest.php similarity index 100% rename from tests/06_Query/QuerySql2OperationsTest.php rename to tests/Query/QuerySql2OperationsTest.php diff --git a/tests/06_Query/RowIteratorTest.php b/tests/Query/RowIteratorTest.php similarity index 100% rename from tests/06_Query/RowIteratorTest.php rename to tests/Query/RowIteratorTest.php diff --git a/tests/06_Query/RowTest.php b/tests/Query/RowTest.php similarity index 100% rename from tests/06_Query/RowTest.php rename to tests/Query/RowTest.php diff --git a/tests/06_Query/Sql1/QueryBaseCase.php b/tests/Query/Sql1/QueryBaseCase.php similarity index 100% rename from tests/06_Query/Sql1/QueryBaseCase.php rename to tests/Query/Sql1/QueryBaseCase.php diff --git a/tests/06_Query/Sql1/QueryOperationsTest.php b/tests/Query/Sql1/QueryOperationsTest.php similarity index 100% rename from tests/06_Query/Sql1/QueryOperationsTest.php rename to tests/Query/Sql1/QueryOperationsTest.php diff --git a/tests/06_Query/XPath/QueryBaseCase.php b/tests/Query/XPath/QueryBaseCase.php similarity index 100% rename from tests/06_Query/XPath/QueryBaseCase.php rename to tests/Query/XPath/QueryBaseCase.php diff --git a/tests/06_Query/XPath/QueryOperationsTest.php b/tests/Query/XPath/QueryOperationsTest.php similarity index 100% rename from tests/06_Query/XPath/QueryOperationsTest.php rename to tests/Query/XPath/QueryOperationsTest.php diff --git a/tests/05_Reading/BinaryReadMethodsTest.php b/tests/Reading/BinaryReadMethodsTest.php similarity index 100% rename from tests/05_Reading/BinaryReadMethodsTest.php rename to tests/Reading/BinaryReadMethodsTest.php diff --git a/tests/05_Reading/EncodingTest.php b/tests/Reading/EncodingTest.php similarity index 100% rename from tests/05_Reading/EncodingTest.php rename to tests/Reading/EncodingTest.php diff --git a/tests/05_Reading/JackalopeFetchDepthTest.php b/tests/Reading/JackalopeFetchDepthTest.php similarity index 100% rename from tests/05_Reading/JackalopeFetchDepthTest.php rename to tests/Reading/JackalopeFetchDepthTest.php diff --git a/tests/05_Reading/NodeReadMethodsTest.php b/tests/Reading/NodeReadMethodsTest.php similarity index 100% rename from tests/05_Reading/NodeReadMethodsTest.php rename to tests/Reading/NodeReadMethodsTest.php diff --git a/tests/05_Reading/PropertyReadMethodsTest.php b/tests/Reading/PropertyReadMethodsTest.php similarity index 100% rename from tests/05_Reading/PropertyReadMethodsTest.php rename to tests/Reading/PropertyReadMethodsTest.php diff --git a/tests/05_Reading/SessionNamespaceRemappingTest.php b/tests/Reading/SessionNamespaceRemappingTest.php similarity index 100% rename from tests/05_Reading/SessionNamespaceRemappingTest.php rename to tests/Reading/SessionNamespaceRemappingTest.php diff --git a/tests/05_Reading/SessionReadMethodsTest.php b/tests/Reading/SessionReadMethodsTest.php similarity index 100% rename from tests/05_Reading/SessionReadMethodsTest.php rename to tests/Reading/SessionReadMethodsTest.php diff --git a/tests/18_LifecycleManagement/TODO b/tests/RetentionAndHold/TODO similarity index 100% rename from tests/18_LifecycleManagement/TODO rename to tests/RetentionAndHold/TODO diff --git a/tests/22_SameNameSiblings/DeleteMethodsTest.php b/tests/SameNameSiblings/DeleteMethodsTest.php similarity index 100% rename from tests/22_SameNameSiblings/DeleteMethodsTest.php rename to tests/SameNameSiblings/DeleteMethodsTest.php diff --git a/tests/22_SameNameSiblings/TODO b/tests/SameNameSiblings/TODO similarity index 100% rename from tests/22_SameNameSiblings/TODO rename to tests/SameNameSiblings/TODO diff --git a/tests/20_RetentionAndHold/TODO b/tests/ShareableNodes/TODO similarity index 100% rename from tests/20_RetentionAndHold/TODO rename to tests/ShareableNodes/TODO diff --git a/tests/21_Transactions/TransactionMethodsTest.php b/tests/Transactions/TransactionMethodsTest.php similarity index 100% rename from tests/21_Transactions/TransactionMethodsTest.php rename to tests/Transactions/TransactionMethodsTest.php diff --git a/tests/15_Versioning/CreateVersionableNodeTest.php b/tests/Versioning/CreateVersionableNodeTest.php similarity index 100% rename from tests/15_Versioning/CreateVersionableNodeTest.php rename to tests/Versioning/CreateVersionableNodeTest.php diff --git a/tests/15_Versioning/NodeTypeReadTest.php b/tests/Versioning/NodeTypeReadTest.php similarity index 100% rename from tests/15_Versioning/NodeTypeReadTest.php rename to tests/Versioning/NodeTypeReadTest.php diff --git a/tests/15_Versioning/SimpleVersionTest.php b/tests/Versioning/SimpleVersionTest.php similarity index 100% rename from tests/15_Versioning/SimpleVersionTest.php rename to tests/Versioning/SimpleVersionTest.php diff --git a/tests/15_Versioning/VersionHistoryTest.php b/tests/Versioning/VersionHistoryTest.php similarity index 100% rename from tests/15_Versioning/VersionHistoryTest.php rename to tests/Versioning/VersionHistoryTest.php diff --git a/tests/15_Versioning/VersionManagerTest.php b/tests/Versioning/VersionManagerTest.php similarity index 100% rename from tests/15_Versioning/VersionManagerTest.php rename to tests/Versioning/VersionManagerTest.php diff --git a/tests/15_Versioning/VersionTest.php b/tests/Versioning/VersionTest.php similarity index 100% rename from tests/15_Versioning/VersionTest.php rename to tests/Versioning/VersionTest.php diff --git a/tests/13_WorkspaceManagement/WorkspaceManagementTest.php b/tests/WorkspaceManagement/WorkspaceManagementTest.php similarity index 100% rename from tests/13_WorkspaceManagement/WorkspaceManagementTest.php rename to tests/WorkspaceManagement/WorkspaceManagementTest.php diff --git a/tests/10_Writing/AddMethodsTest.php b/tests/Writing/AddMethodsTest.php similarity index 100% rename from tests/10_Writing/AddMethodsTest.php rename to tests/Writing/AddMethodsTest.php diff --git a/tests/10_Writing/CloneMethodsTest.php b/tests/Writing/CloneMethodsTest.php similarity index 100% rename from tests/10_Writing/CloneMethodsTest.php rename to tests/Writing/CloneMethodsTest.php diff --git a/tests/10_Writing/CombinedManipulationsTest.php b/tests/Writing/CombinedManipulationsTest.php similarity index 100% rename from tests/10_Writing/CombinedManipulationsTest.php rename to tests/Writing/CombinedManipulationsTest.php diff --git a/tests/10_Writing/CopyMethodsTest.php b/tests/Writing/CopyMethodsTest.php similarity index 100% rename from tests/10_Writing/CopyMethodsTest.php rename to tests/Writing/CopyMethodsTest.php diff --git a/tests/10_Writing/DeleteMethodsTest.php b/tests/Writing/DeleteMethodsTest.php similarity index 100% rename from tests/10_Writing/DeleteMethodsTest.php rename to tests/Writing/DeleteMethodsTest.php diff --git a/tests/10_Writing/EncodingTest.php b/tests/Writing/EncodingTest.php similarity index 100% rename from tests/10_Writing/EncodingTest.php rename to tests/Writing/EncodingTest.php diff --git a/tests/10_Writing/ItemStateTest.php b/tests/Writing/ItemStateTest.php similarity index 100% rename from tests/10_Writing/ItemStateTest.php rename to tests/Writing/ItemStateTest.php diff --git a/tests/10_Writing/LastModifiedTest.php b/tests/Writing/LastModifiedTest.php similarity index 100% rename from tests/10_Writing/LastModifiedTest.php rename to tests/Writing/LastModifiedTest.php diff --git a/tests/10_Writing/LastModifiedUpdateTest.php b/tests/Writing/LastModifiedUpdateTest.php similarity index 100% rename from tests/10_Writing/LastModifiedUpdateTest.php rename to tests/Writing/LastModifiedUpdateTest.php diff --git a/tests/10_Writing/MixinCreatedTest.php b/tests/Writing/MixinCreatedTest.php similarity index 100% rename from tests/10_Writing/MixinCreatedTest.php rename to tests/Writing/MixinCreatedTest.php diff --git a/tests/10_Writing/MixinReferenceableTest.php b/tests/Writing/MixinReferenceableTest.php similarity index 100% rename from tests/10_Writing/MixinReferenceableTest.php rename to tests/Writing/MixinReferenceableTest.php diff --git a/tests/10_Writing/MoveMethodsTest.php b/tests/Writing/MoveMethodsTest.php similarity index 100% rename from tests/10_Writing/MoveMethodsTest.php rename to tests/Writing/MoveMethodsTest.php diff --git a/tests/10_Writing/NamespaceRegistryTest.php b/tests/Writing/NamespaceRegistryTest.php similarity index 100% rename from tests/10_Writing/NamespaceRegistryTest.php rename to tests/Writing/NamespaceRegistryTest.php diff --git a/tests/10_Writing/NodeTypeAssignementTest.php b/tests/Writing/NodeTypeAssignementTest.php similarity index 100% rename from tests/10_Writing/NodeTypeAssignementTest.php rename to tests/Writing/NodeTypeAssignementTest.php diff --git a/tests/10_Writing/NodeTypePreemptiveValidationTest.php b/tests/Writing/NodeTypePreemptiveValidationTest.php similarity index 100% rename from tests/10_Writing/NodeTypePreemptiveValidationTest.php rename to tests/Writing/NodeTypePreemptiveValidationTest.php diff --git a/tests/10_Writing/SetPropertyDynamicRebindingTest.php b/tests/Writing/SetPropertyDynamicRebindingTest.php similarity index 100% rename from tests/10_Writing/SetPropertyDynamicRebindingTest.php rename to tests/Writing/SetPropertyDynamicRebindingTest.php diff --git a/tests/10_Writing/SetPropertyMethodsTest.php b/tests/Writing/SetPropertyMethodsTest.php similarity index 100% rename from tests/10_Writing/SetPropertyMethodsTest.php rename to tests/Writing/SetPropertyMethodsTest.php diff --git a/tests/10_Writing/SetPropertyTypesTest.php b/tests/Writing/SetPropertyTypesTest.php similarity index 100% rename from tests/10_Writing/SetPropertyTypesTest.php rename to tests/Writing/SetPropertyTypesTest.php From 8c0458df65a5a30fe4d678f81fc077579f8cca92 Mon Sep 17 00:00:00 2001 From: dantleech Date: Sat, 27 Jun 2015 18:20:35 +0200 Subject: [PATCH 5/7] Modified licence date --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index a946c0e6..111799d2 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -2,7 +2,7 @@ phpcr-api-tests is dual licensed under the MIT license and the Apache License Ve The MIT License (MIT) - Copyright (c) 2013 Liip and others + Copyright (c) 2015 Liip and others Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From 8bab3e07a91861a4ff7ac0c3c0c1035c52d50899 Mon Sep 17 00:00:00 2001 From: dantleech Date: Sat, 27 Jun 2015 18:22:12 +0200 Subject: [PATCH 6/7] Switched back to inc/ for BC --- .php_cs | 3 +- bootstrap.dist.php | 8 +- composer.json | 2 +- {lib => inc}/AbstractLoader.php | 2 +- {lib => inc}/BaseCase.php | 14 +-- {lib => inc}/FixtureLoaderInterface.php | 2 +- .../Connecting/RepositoryDescriptorsTest.php | 2 +- tests/Connecting/RepositoryFactoryTest.php | 2 +- tests/Connecting/RepositoryTest.php | 2 +- tests/Connecting/SessionReadMethodsTest.php | 2 +- tests/Connecting/SimpleCredentialsTest.php | 2 +- tests/Connecting/WorkspaceReadMethodsTest.php | 2 +- tests/Export/ExportRepositoryContentTest.php | 34 ++++---- tests/Import/ImportRepositoryContentTest.php | 28 +++--- tests/Locking/LockManagerTest.php | 6 +- .../NodeTypeDiscovery/NodeDefinitionTest.php | 4 +- .../NodeNodeTypeReadMethodsTest.php | 2 +- .../NodeTypeDiscoveryTest.php | 2 +- tests/NodeTypeDiscovery/NodeTypeTest.php | 2 +- .../PropertyDefinitionTest.php | 4 +- tests/NodeTypeManagement/CndTest.php | 2 +- tests/NodeTypeManagement/NodeTypeBaseCase.php | 2 +- tests/NodeTypeManagement/NodeTypeTest.php | 2 +- tests/Observation/ObservationManagerTest.php | 34 ++++---- tests/OrderableChildNodes/OrderBeforeTest.php | 8 +- .../PermissionReadTest.php | 2 +- tests/PhpcrUtils/CndParserTest.php | 12 +-- tests/PhpcrUtils/CndWriterTest.php | 2 +- tests/PhpcrUtils/PurgeTest.php | 2 +- tests/Query/CharacterTest.php | 2 +- tests/Query/NodeViewTest.php | 2 +- .../QOM/ConvertQueriesBackAndForthTest.php | 2 +- tests/Query/QOM/QomTestQueries.php | 2 +- tests/Query/QOM/QomToSql2ConverterTest.php | 2 +- tests/Query/QOM/Sql2ScannerTest.php | 2 +- tests/Query/QOM/Sql2TestQueries.php | 2 +- tests/Query/QOM/Sql2ToQomConverterTest.php | 2 +- tests/Query/QueryBaseCase.php | 2 +- tests/Query/QueryManagerTest.php | 2 +- tests/Query/QueryObjectQOMTest.php | 6 +- tests/Query/QueryObjectSql2Test.php | 2 +- tests/Query/QueryResultsTest.php | 2 +- tests/Query/QuerySql2OperationsTest.php | 2 +- tests/Query/RowIteratorTest.php | 2 +- tests/Query/RowTest.php | 2 +- tests/Query/Sql1/QueryBaseCase.php | 2 +- tests/Query/Sql1/QueryOperationsTest.php | 2 +- tests/Query/XPath/QueryBaseCase.php | 2 +- tests/Query/XPath/QueryOperationsTest.php | 2 +- tests/Reading/BinaryReadMethodsTest.php | 2 +- tests/Reading/EncodingTest.php | 2 +- tests/Reading/JackalopeFetchDepthTest.php | 2 +- tests/Reading/NodeReadMethodsTest.php | 2 +- tests/Reading/PropertyReadMethodsTest.php | 2 +- .../Reading/SessionNamespaceRemappingTest.php | 2 +- tests/Reading/SessionReadMethodsTest.php | 2 +- tests/SameNameSiblings/DeleteMethodsTest.php | 12 +-- tests/Transactions/TransactionMethodsTest.php | 6 +- .../Versioning/CreateVersionableNodeTest.php | 2 +- tests/Versioning/NodeTypeReadTest.php | 2 +- tests/Versioning/SimpleVersionTest.php | 2 +- tests/Versioning/VersionHistoryTest.php | 2 +- tests/Versioning/VersionManagerTest.php | 2 +- tests/Versioning/VersionTest.php | 2 +- .../WorkspaceManagementTest.php | 8 +- tests/Writing/AddMethodsTest.php | 44 +++++----- tests/Writing/CloneMethodsTest.php | 14 +-- tests/Writing/CombinedManipulationsTest.php | 86 +++++++++---------- tests/Writing/CopyMethodsTest.php | 4 +- tests/Writing/DeleteMethodsTest.php | 22 ++--- tests/Writing/EncodingTest.php | 2 +- tests/Writing/ItemStateTest.php | 2 +- tests/Writing/LastModifiedTest.php | 2 +- tests/Writing/LastModifiedUpdateTest.php | 2 +- tests/Writing/MixinCreatedTest.php | 6 +- tests/Writing/MixinReferenceableTest.php | 2 +- tests/Writing/MoveMethodsTest.php | 56 ++++++------ tests/Writing/NamespaceRegistryTest.php | 2 +- tests/Writing/NodeTypeAssignementTest.php | 4 +- .../NodeTypePreemptiveValidationTest.php | 2 +- .../SetPropertyDynamicRebindingTest.php | 10 +-- tests/Writing/SetPropertyMethodsTest.php | 16 ++-- tests/Writing/SetPropertyTypesTest.php | 2 +- 83 files changed, 282 insertions(+), 283 deletions(-) rename {lib => inc}/AbstractLoader.php (99%) rename {lib => inc}/BaseCase.php (95%) rename {lib => inc}/FixtureLoaderInterface.php (95%) diff --git a/.php_cs b/.php_cs index c7c12d3e..ebd2145d 100644 --- a/.php_cs +++ b/.php_cs @@ -3,7 +3,7 @@ $header = <<getName(); + $case = $chapter.$case; + $test = "$case::".$this->getName(); if (!self::$loader->getTestSupported($chapter, $case, $test)) { - $this->markTestSkipped('Test ' . $this->getName() . ' not supported by this implementation'); + $this->markTestSkipped('Test '.$this->getName().' not supported by this implementation'); } $this->sharedFixture = self::$staticSharedFixture; @@ -277,7 +277,7 @@ protected function assertSimilarDateTime($expected, $data) $this->assertInstanceOf('\DateTime', $expected); $this->assertInstanceOf('\DateTime', $data); $this->assertTrue(abs($expected->getTimestamp() - $data->getTimestamp()) <= 3, - $data->format('c') . ' is not close to the expected ' . $expected->format('c') + $data->format('c').' is not close to the expected '.$expected->format('c') ); } @@ -291,7 +291,7 @@ protected function assertSimilarDateTime($expected, $data) protected function skipIfNotSupported($descriptor) { if (false === $this->session->getRepository()->getDescriptor($descriptor)) { - $this->markTestSkipped('Descriptor "' . $descriptor . '" not supported'); + $this->markTestSkipped('Descriptor "'.$descriptor.'" not supported'); } return true; diff --git a/lib/FixtureLoaderInterface.php b/inc/FixtureLoaderInterface.php similarity index 95% rename from lib/FixtureLoaderInterface.php rename to inc/FixtureLoaderInterface.php index d6c2b272..7159ff7a 100644 --- a/lib/FixtureLoaderInterface.php +++ b/inc/FixtureLoaderInterface.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Connecting/RepositoryDescriptorsTest.php b/tests/Connecting/RepositoryDescriptorsTest.php index cfa4fffd..18a07e11 100644 --- a/tests/Connecting/RepositoryDescriptorsTest.php +++ b/tests/Connecting/RepositoryDescriptorsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Connecting/RepositoryFactoryTest.php b/tests/Connecting/RepositoryFactoryTest.php index 67fb8fcc..ee909b28 100644 --- a/tests/Connecting/RepositoryFactoryTest.php +++ b/tests/Connecting/RepositoryFactoryTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Connecting/RepositoryTest.php b/tests/Connecting/RepositoryTest.php index 062c01c0..4c9d01da 100644 --- a/tests/Connecting/RepositoryTest.php +++ b/tests/Connecting/RepositoryTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Connecting/SessionReadMethodsTest.php b/tests/Connecting/SessionReadMethodsTest.php index b7f95cc5..78f5505b 100644 --- a/tests/Connecting/SessionReadMethodsTest.php +++ b/tests/Connecting/SessionReadMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Connecting/SimpleCredentialsTest.php b/tests/Connecting/SimpleCredentialsTest.php index af0e32f0..76cd3ef0 100644 --- a/tests/Connecting/SimpleCredentialsTest.php +++ b/tests/Connecting/SimpleCredentialsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Connecting/WorkspaceReadMethodsTest.php b/tests/Connecting/WorkspaceReadMethodsTest.php index f663a1fc..fa1f2bb5 100644 --- a/tests/Connecting/WorkspaceReadMethodsTest.php +++ b/tests/Connecting/WorkspaceReadMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Export/ExportRepositoryContentTest.php b/tests/Export/ExportRepositoryContentTest.php index 21f68c6c..c033be1e 100644 --- a/tests/Export/ExportRepositoryContentTest.php +++ b/tests/Export/ExportRepositoryContentTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -35,7 +35,7 @@ public function testExportSystemView() $output->loadXML(stream_get_contents($stream)); $expected = new DOMDocument(); $expected->preserveWhiteSpace = false; - $expected->load(__DIR__ . '/../../fixtures/07_Export/systemview.xml'); + $expected->load(__DIR__.'/../../fixtures/07_Export/systemview.xml'); fclose($stream); $this->assertEquivalentSystem($expected->documentElement, $output->documentElement, new DOMXPath($output)); } @@ -55,12 +55,12 @@ private function buildPath(DOMNode $n) if ($name == null) { $elem = 'sv:node(unnamed)'; } else { - $elem = $n->tagName . '(' . $name->value . ')'; + $elem = $n->tagName.'('.$name->value.')'; } } else { $elem = $n->nodeName; } - $ret = $elem . '/' . $ret; + $ret = $elem.'/'.$ret; $n = $n->parentNode; } @@ -85,7 +85,7 @@ private function assertEquivalentSystem(DOMElement $expected, DOMElement $output foreach ($expected->attributes as $attr) { //i.e. sv:name attribute $oattr = $output->attributes->getNamedItem($attr->name); - $this->assertNotNull($oattr, 'missing attribute ' . $attr->name); + $this->assertNotNull($oattr, 'missing attribute '.$attr->name); $this->assertEquals($attr->value, $oattr->value, 'wrong attribute value'); } @@ -97,12 +97,12 @@ private function assertEquivalentSystem(DOMElement $expected, DOMElement $output foreach ($expected->childNodes as $index => $child) { $this->assertEquals('sv:value', $child->tagName); $o = $output->childNodes->item($index); - $this->assertInstanceOf('DOMElement', $o, "No child element at $index in " . $this->buildPath($child)); - $this->assertEquals('sv:value', $o->tagName, 'Unexpected tag name at ' . $this->buildPath($expected) . "sv:value[$index]"); + $this->assertInstanceOf('DOMElement', $o, "No child element at $index in ".$this->buildPath($child)); + $this->assertEquals('sv:value', $o->tagName, 'Unexpected tag name at '.$this->buildPath($expected)."sv:value[$index]"); if ($this->isDate($child->textContent) && $this->isDate($o->textContent)) { - $this->assertEqualDateString($child->textContent, $o->textContent, 'Not the same date at ' . $this->buildPath($output) . "sv:value[$index]"); + $this->assertEqualDateString($child->textContent, $o->textContent, 'Not the same date at '.$this->buildPath($output)."sv:value[$index]"); } else { - $this->assertEquals($child->textContent, $o->textContent, 'Not the same text at ' . $this->buildPath($output) . "sv:value[$index]"); + $this->assertEquals($child->textContent, $o->textContent, 'Not the same text at '.$this->buildPath($output)."sv:value[$index]"); } } } @@ -111,8 +111,8 @@ private function assertEquivalentSystem(DOMElement $expected, DOMElement $output foreach ($expected->childNodes as $child) { $this->assertContains($child->tagName, array('sv:property', 'sv:node'), 'unexpected child of sv:node'); $childname = $child->attributes->getNamedItem('name')->value; - $q = $oxpath->query($child->tagName . '[@sv:name="' . $childname . '"]', $output); - $this->assertEquals(1, $q->length, 'expected to find exactly one node named ' . $childname . ' under ' . $this->buildPath($output)); + $q = $oxpath->query($child->tagName.'[@sv:name="'.$childname.'"]', $output); + $this->assertEquals(1, $q->length, 'expected to find exactly one node named '.$childname.' under '.$this->buildPath($output)); $this->assertEquivalentSystem($child, $q->item(0), $oxpath); } } @@ -128,7 +128,7 @@ public function testExportDocumentView() $output->loadXML(stream_get_contents($stream)); $expected = new DOMDocument(); $expected->preserveWhiteSpace = false; - $expected->load(__DIR__ . '/../../fixtures/07_Export/documentview.xml'); + $expected->load(__DIR__.'/../../fixtures/07_Export/documentview.xml'); fclose($stream); $this->assertEquivalentDocument($expected->documentElement, $output->documentElement, new DOMXPath($output)); } @@ -142,7 +142,7 @@ public function testExportDocumentView() private function assertEquivalentDocument(DOMElement $expected, DOMElement $output, DOMXPath $oxpath) { if ($expected instanceof DOMText) { - $this->assertEquals($expected->textContent, $output->textContent, 'Not the same text at ' . $this->buildPath($expected)); + $this->assertEquals($expected->textContent, $output->textContent, 'Not the same text at '.$this->buildPath($expected)); } elseif ($expected instanceof DOMElement) { $this->assertEquals($expected->tagName, $output->tagName); @@ -151,18 +151,18 @@ private function assertEquivalentDocument(DOMElement $expected, DOMElement $outp $this->assertNotEmpty($attr->value); } else { $oattr = $output->attributes->getNamedItem($attr->name); - $this->assertNotNull($oattr, 'missing attribute ' . $attr->name . ' at ' . $this->buildPath($expected)); + $this->assertNotNull($oattr, 'missing attribute '.$attr->name.' at '.$this->buildPath($expected)); if ($this->isDate($attr->value) && $this->isDate($oattr->value)) { - $this->assertEqualDateString($attr->value, $oattr->value, 'wrong attribute value at ' . $this->buildPath($expected) . '/' . $attr->name); + $this->assertEqualDateString($attr->value, $oattr->value, 'wrong attribute value at '.$this->buildPath($expected).'/'.$attr->name); } else { - $this->assertEquals($attr->value, $oattr->value, 'wrong attribute value at ' . $this->buildPath($expected) . '/' . $attr->name); + $this->assertEquals($attr->value, $oattr->value, 'wrong attribute value at '.$this->buildPath($expected).'/'.$attr->name); } } } foreach ($expected->childNodes as $child) { $q = $oxpath->query($child->tagName, $output); //TODO: same-name siblings - $this->assertEquals(1, $q->length, 'expected to find exactly one node named ' . $child->tagName . ' under ' . $this->buildPath($expected)); + $this->assertEquals(1, $q->length, 'expected to find exactly one node named '.$child->tagName.' under '.$this->buildPath($expected)); $this->assertEquivalentDocument($child, $q->item(0), $oxpath); } } diff --git a/tests/Import/ImportRepositoryContentTest.php b/tests/Import/ImportRepositoryContentTest.php index 59d560a8..e2661211 100644 --- a/tests/Import/ImportRepositoryContentTest.php +++ b/tests/Import/ImportRepositoryContentTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -42,7 +42,7 @@ public function testImportXMLSystemWorkspace() private function doTestImportXMLSystem($connect, $session) { - $connect->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $connect->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); $this->assertTrue($session->nodeExists('/tests_general_base')); $this->assertTrue($session->propertyExists('/tests_general_base/idExample/jcr:content/weakreference_target/jcr:uuid')); @@ -72,14 +72,14 @@ private function doTestImportXMLSystem($connect, $session) */ public function testImportXMLSystemPathNotFoundSession() { - $this->session->importXML('/inexistent-path', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $this->session->importXML('/inexistent-path', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); } /** * @expectedException \PHPCR\PathNotFoundException */ public function testImportXMLSystemPathNotFoundWorkspace() { - $this->session->getWorkspace()->importXML('/inexistent-path', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $this->session->getWorkspace()->importXML('/inexistent-path', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); } /** @@ -89,7 +89,7 @@ public function testImportXMLSystemIdCollisionSession() { self::$staticSharedFixture['ie']->import('11_Import/idnode'); $session = $this->renewSession(); - $session->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $session->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); } /** @@ -99,7 +99,7 @@ public function testImportXMLSystemIdCollisionWorkspace() { self::$staticSharedFixture['ie']->import('11_Import/idnode'); $session = $this->renewSession(); - $session->getWorkspace()->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $session->getWorkspace()->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); } /** @@ -111,7 +111,7 @@ public function testImportXMLUuidRemoveParentSession() { self::$staticSharedFixture['ie']->import('11_Import/idnode'); $session = $this->renewSession(); - $session->importXML('/container/idExample', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); + $session->importXML('/container/idExample', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); } /** @@ -123,7 +123,7 @@ public function testImportXMLUuidRemoveParentWorkspace() { self::$staticSharedFixture['ie']->import('11_Import/idnode'); $session = $this->renewSession(); - $session->getWorkspace()->importXML('/container/idExample', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); + $session->getWorkspace()->importXML('/container/idExample', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); } public function testImportXMLUuidNewSession() @@ -140,7 +140,7 @@ public function testImportXMLUuidNewWorkspace() } private function doTestImportXMLUuidNew($connect, $session) { - $connect->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_CREATE_NEW); + $connect->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_CREATE_NEW); // existing node did not change its uuid $this->assertTrue($session->nodeExists('/container/idExample')); @@ -201,7 +201,7 @@ public function testImportXMLUuidRemoveExistingWorkspace() private function doTestImportXMLUuidRemoveExisting($connect, $session) { - $connect->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); + $connect->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REMOVE_EXISTING); // existing node removed $this->assertFalse($session->nodeExists('/container/idExample')); @@ -252,7 +252,7 @@ public function testImportXMLUuidReplaceExistingWorkspace() } private function doTestImportXMLUuidReplaceExisting($connect, $session) { - $session->importXML('/', __DIR__ . '/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REPLACE_EXISTING); + $session->importXML('/', __DIR__.'/../../fixtures/general/base.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REPLACE_EXISTING); // existing node replaced $this->assertTrue($session->nodeExists('/container/idExample')); @@ -301,7 +301,7 @@ public function testImportXMLUuidReplaceRoot() $this->assertTrue(\PHPCR\Util\UUIDHelper::isUUID($id)); $filename = tempnam('/tmp', ''); $file = fopen($filename, 'w+'); - fwrite($file, str_replace('XXX_ROOT_ID_XXX', $id, file_get_contents(__DIR__ . '/../../fixtures/11_Import/rootnode.xml'))); + fwrite($file, str_replace('XXX_ROOT_ID_XXX', $id, file_get_contents(__DIR__.'/../../fixtures/11_Import/rootnode.xml'))); fclose($file); $session->importXML('/', $filename, ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_REPLACE_EXISTING); @@ -344,7 +344,7 @@ public function testImportXMLDocument() self::$staticSharedFixture['ie']->import('11_Import/idnode'); $session = $this->renewSession(); - $session->importXML('/', __DIR__ . '/../../fixtures/11_Import/documentview.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_CREATE_NEW); + $session->importXML('/', __DIR__.'/../../fixtures/11_Import/documentview.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_CREATE_NEW); // existing node did not change its uuid $this->assertTrue($session->nodeExists('/container/idExample')); @@ -384,7 +384,7 @@ public function testImportXMLDocumentSimple() self::$staticSharedFixture['ie']->import('11_Import/empty'); $session = $this->renewSession(); - $session->importXML('/', __DIR__ . '/../../fixtures/11_Import/simple.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); + $session->importXML('/', __DIR__.'/../../fixtures/11_Import/simple.xml', ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW); $this->assertTrue($session->nodeExists('/data/node')); $this->assertTrue($session->nodeExists('/data/sibling/child1')); diff --git a/tests/Locking/LockManagerTest.php b/tests/Locking/LockManagerTest.php index b1dd982c..17b57a59 100644 --- a/tests/Locking/LockManagerTest.php +++ b/tests/Locking/LockManagerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -57,7 +57,7 @@ public function testLockAlreadyLocked() $this->lm->lock('/lockable-node', true, true, 3, ''); } catch (\PHPCR\Lock\LockException $ex) { // The lock didn't work, Huston, there is a problem... - $this->fail('An error occurred while trying to lock a valid node: ' . $ex->getMessage()); + $this->fail('An error occurred while trying to lock a valid node: '.$ex->getMessage()); } // The second lock should not work @@ -78,7 +78,7 @@ public function testLockDeepOnAlreadyLocked() try { $this->lm->lock('/lockable-parent/lockable-child', true, true, 3, ''); } catch (\PHPCR\Lock\LockException $ex) { - $this->fail('An error occurred while trying to lock a valid node: ' . $ex->getMessage()); + $this->fail('An error occurred while trying to lock a valid node: '.$ex->getMessage()); } // The *deep* lock on the parent should not work diff --git a/tests/NodeTypeDiscovery/NodeDefinitionTest.php b/tests/NodeTypeDiscovery/NodeDefinitionTest.php index 63b5bf42..c4c8522c 100644 --- a/tests/NodeTypeDiscovery/NodeDefinitionTest.php +++ b/tests/NodeTypeDiscovery/NodeDefinitionTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -52,7 +52,7 @@ public function setUp() $this->assertInstanceOf('\PHPCR\NodeType\NodeDefinitionInterface', $this->hierarchyNodeDef); $this->assertEquals('*', $this->hierarchyNodeDef->getName()); } catch (\Exception $e) { - $this->markTestSkipped('getChildNodeDefinitions not working as it should, skipping tests about NodeDefinitionInterface: ' . $e->getMessage()); + $this->markTestSkipped('getChildNodeDefinitions not working as it should, skipping tests about NodeDefinitionInterface: '.$e->getMessage()); } } public function testAllowsSameNameSiblings() diff --git a/tests/NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php b/tests/NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php index 605035e7..059b0d44 100644 --- a/tests/NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php +++ b/tests/NodeTypeDiscovery/NodeNodeTypeReadMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/NodeTypeDiscovery/NodeTypeDiscoveryTest.php b/tests/NodeTypeDiscovery/NodeTypeDiscoveryTest.php index 38b829d6..b6027aa2 100644 --- a/tests/NodeTypeDiscovery/NodeTypeDiscoveryTest.php +++ b/tests/NodeTypeDiscovery/NodeTypeDiscoveryTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/NodeTypeDiscovery/NodeTypeTest.php b/tests/NodeTypeDiscovery/NodeTypeTest.php index 565ec625..55bc44e0 100644 --- a/tests/NodeTypeDiscovery/NodeTypeTest.php +++ b/tests/NodeTypeDiscovery/NodeTypeTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/NodeTypeDiscovery/PropertyDefinitionTest.php b/tests/NodeTypeDiscovery/PropertyDefinitionTest.php index 9b1018fd..b32fe809 100644 --- a/tests/NodeTypeDiscovery/PropertyDefinitionTest.php +++ b/tests/NodeTypeDiscovery/PropertyDefinitionTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -107,7 +107,7 @@ public function setUp() } $this->assertNotNull($this->data); } catch (\Exception $e) { - $this->markTestSkipped('getChildNodeDefinitions not working as it should, skipping tests about NodeDefinitionInterface: ' . $e->getMessage()); + $this->markTestSkipped('getChildNodeDefinitions not working as it should, skipping tests about NodeDefinitionInterface: '.$e->getMessage()); } } diff --git a/tests/NodeTypeManagement/CndTest.php b/tests/NodeTypeManagement/CndTest.php index 78bc0d27..0fe00486 100644 --- a/tests/NodeTypeManagement/CndTest.php +++ b/tests/NodeTypeManagement/CndTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/NodeTypeManagement/NodeTypeBaseCase.php b/tests/NodeTypeManagement/NodeTypeBaseCase.php index 0a0281f3..5067670a 100644 --- a/tests/NodeTypeManagement/NodeTypeBaseCase.php +++ b/tests/NodeTypeManagement/NodeTypeBaseCase.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/NodeTypeManagement/NodeTypeTest.php b/tests/NodeTypeManagement/NodeTypeTest.php index 767a2a49..c7b94dcf 100644 --- a/tests/NodeTypeManagement/NodeTypeTest.php +++ b/tests/NodeTypeManagement/NodeTypeTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Observation/ObservationManagerTest.php b/tests/Observation/ObservationManagerTest.php index 466d6ec5..2e9b226a 100644 --- a/tests/Observation/ObservationManagerTest.php +++ b/tests/Observation/ObservationManagerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -111,7 +111,7 @@ public function testFilteredEventJournalUuid() $journal = $om->getEventJournal($filter); $journal->skipTo($curTime); $this->assertTrue($journal->valid()); - $this->assertEquals($this->nodePath . '/ref', $journal->current()->getPath()); + $this->assertEquals($this->nodePath.'/ref', $journal->current()->getPath()); $this->assertEquals(EventInterface::PROPERTY_ADDED, $journal->current()->getType()); $journal->next(); @@ -140,7 +140,7 @@ public function testFilteredEventJournalNodeType() // At this point the journal should only contain the NODE_ADDED event $this->assertTrue($journal->valid()); - $this->assertEquals($this->nodePath . '/folder', $journal->current()->getPath()); + $this->assertEquals($this->nodePath.'/folder', $journal->current()->getPath()); $this->assertEquals(EventInterface::NODE_ADDED, $journal->current()->getType()); $type = $journal->current()->getPrimaryNodeType(); $this->assertInstanceOf('PHPCR\NodeType\NodeTypeInterface', $type); @@ -209,7 +209,7 @@ protected function assertFilterOnEventType(ObservationManagerInterface $observat protected function assertFilterOnPathNoDeep(ObservationManagerInterface $observationManager, $curTime) { $filter = $observationManager->createEventFilter(); - $filter->setAbsPath($this->nodePath . '/child'); + $filter->setAbsPath($this->nodePath.'/child'); $journal = $observationManager->getEventJournal($filter); $journal->skipTo($curTime); @@ -218,14 +218,14 @@ protected function assertFilterOnPathNoDeep(ObservationManagerInterface $observa while ($journal->valid()) { $event = $journal->current(); $journal->next(); - $this->assertEquals($this->nodePath . '/child', $event->getPath()); + $this->assertEquals($this->nodePath.'/child', $event->getPath()); } } protected function assertFilterOnPathDeep(ObservationManagerInterface $observationManager, $curTime) { $filter = $observationManager->createEventFilter(); - $filter->setAbsPath($this->nodePath . '/child'); + $filter->setAbsPath($this->nodePath.'/child'); $filter->setIsDeep(true); $journal = $observationManager->getEventJournal($filter); $journal->skipTo($curTime); @@ -237,7 +237,7 @@ protected function assertFilterOnPathDeep(ObservationManagerInterface $observati $journal->next(); // Notice the assertion is slightly different from the one in testFilterOnPathNoDeep - $this->assertTrue(substr($event->getPath(), 0, strlen($this->nodePath . '/child')) === $this->nodePath . '/child'); + $this->assertTrue(substr($event->getPath(), 0, strlen($this->nodePath.'/child')) === $this->nodePath.'/child'); } } @@ -316,7 +316,7 @@ protected function produceEvents(SessionInterface $session) $session->save(); // Will cause a NODE_REMOVED + NODE_ADDED + NODE_MOVED events - $session->move($node->getPath(), $this->nodePath . '/moved'); + $session->move($node->getPath(), $this->nodePath.'/moved'); // Will cause a PERSIST event $session->save(); @@ -405,15 +405,15 @@ protected function expectEvents(EventJournalInterface $journal, $startDate) // The order is implementation specific (Jackrabbit will trigger the prop added before the node added event) $this->expectEventsInAnyOrder($journal, array( - array(EventInterface::NODE_ADDED, $this->nodePath . '/child'), - array(EventInterface::PROPERTY_ADDED, $this->nodePath . '/child/jcr%3aprimaryType'), + array(EventInterface::NODE_ADDED, $this->nodePath.'/child'), + array(EventInterface::PROPERTY_ADDED, $this->nodePath.'/child/jcr%3aprimaryType'), ) ); $this->assertEvent(EventInterface::PERSIST, '', $journal->current()); $journal->next(); - $this->assertEvent(EventInterface::PROPERTY_ADDED, $this->nodePath . '/child/prop', $journal->current()); + $this->assertEvent(EventInterface::PROPERTY_ADDED, $this->nodePath.'/child/prop', $journal->current()); $journal->next(); $this->assertEvent(EventInterface::PERSIST, '', $journal->current()); @@ -432,13 +432,13 @@ protected function expectEvents(EventJournalInterface $journal, $startDate) } $journal->next(); - $this->assertEvent(EventInterface::PROPERTY_CHANGED, $this->nodePath . '/child/prop', $journal->current()); + $this->assertEvent(EventInterface::PROPERTY_CHANGED, $this->nodePath.'/child/prop', $journal->current()); $journal->next(); $this->assertEvent(EventInterface::PERSIST, '', $journal->current()); $journal->next(); - $this->assertEvent(EventInterface::PROPERTY_REMOVED, $this->nodePath . '/child/prop', $journal->current()); + $this->assertEvent(EventInterface::PROPERTY_REMOVED, $this->nodePath.'/child/prop', $journal->current()); $journal->next(); $this->assertEvent(EventInterface::PERSIST, '', $journal->current()); @@ -449,9 +449,9 @@ protected function expectEvents(EventJournalInterface $journal, $startDate) // The order of the events is implementation specific. $events = $this->expectEventsInAnyOrder($journal, array( - array(EventInterface::NODE_REMOVED, $this->nodePath . '/child'), - array(EventInterface::NODE_ADDED, $this->nodePath . '/moved'), - array(EventInterface::NODE_MOVED, $this->nodePath . '/moved'), + array(EventInterface::NODE_REMOVED, $this->nodePath.'/child'), + array(EventInterface::NODE_ADDED, $this->nodePath.'/moved'), + array(EventInterface::NODE_MOVED, $this->nodePath.'/moved'), ) ); foreach ($events as $event) { @@ -465,7 +465,7 @@ protected function expectEvents(EventJournalInterface $journal, $startDate) $this->assertEvent(EventInterface::PERSIST, '', $journal->current()); $journal->next(); - $this->assertEvent(EventInterface::NODE_REMOVED, $this->nodePath . '/moved', $journal->current()); + $this->assertEvent(EventInterface::NODE_REMOVED, $this->nodePath.'/moved', $journal->current()); $journal->next(); $this->assertEvent(EventInterface::PERSIST, '', $journal->current()); diff --git a/tests/OrderableChildNodes/OrderBeforeTest.php b/tests/OrderableChildNodes/OrderBeforeTest.php index 4ebac69d..b72cbeb1 100644 --- a/tests/OrderableChildNodes/OrderBeforeTest.php +++ b/tests/OrderableChildNodes/OrderBeforeTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -396,8 +396,8 @@ public function testNodeOrderAfterOrderAndMove() $srcParentNode->orderBefore('three', 'two'); $dstParentNode->orderBefore('three', 'two'); - $this->session->move($src . '/three', $dst . '/moved-three'); - $dstNode = $this->session->getNode($dst . '/moved-three'); + $this->session->move($src.'/three', $dst.'/moved-three'); + $dstNode = $this->session->getNode($dst.'/moved-three'); $this->assertInstanceOf('PHPCR\NodeInterface', $dstNode); $dstParentNode = $this->session->getNode($dst); @@ -410,7 +410,7 @@ public function testNodeOrderAfterOrderAndMove() $session = $this->renewSession(); - $dstNode = $session->getNode($dst . '/moved-three'); + $dstNode = $session->getNode($dst.'/moved-three'); $this->assertInstanceOf('PHPCR\NodeInterface', $dstNode); $dstParentNode = $session->getNode($dst); diff --git a/tests/PermissionsAndCapabilities/PermissionReadTest.php b/tests/PermissionsAndCapabilities/PermissionReadTest.php index a4175025..7774aec7 100644 --- a/tests/PermissionsAndCapabilities/PermissionReadTest.php +++ b/tests/PermissionsAndCapabilities/PermissionReadTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/PhpcrUtils/CndParserTest.php b/tests/PhpcrUtils/CndParserTest.php index 1f3fe498..5e53f2e3 100644 --- a/tests/PhpcrUtils/CndParserTest.php +++ b/tests/PhpcrUtils/CndParserTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -30,19 +30,19 @@ public function setUp() public function testParseNormal() { - $res = $this->cndParser->parseFile(__DIR__ . '/resources/cnd/example.cnd'); + $res = $this->cndParser->parseFile(__DIR__.'/resources/cnd/example.cnd'); $this->assertExampleCnd($res); } public function testParseCompact() { - $res = $this->cndParser->parseFile(__DIR__ . '/resources/cnd/example.compact.cnd'); + $res = $this->cndParser->parseFile(__DIR__.'/resources/cnd/example.compact.cnd'); $this->assertExampleCnd($res); } public function testParseVerbose() { - $res = $this->cndParser->parseFile(__DIR__ . '/resources/cnd/example.verbose.cnd'); + $res = $this->cndParser->parseFile(__DIR__.'/resources/cnd/example.verbose.cnd'); $this->assertExampleCnd($res); } @@ -143,7 +143,7 @@ public function testScannerErrorNewline() */ public function testNoStopAtEofError() { - $res = $this->cndParser->parseFile(__DIR__ . '/resources/cnd/no-stop-at-eof.cnd'); + $res = $this->cndParser->parseFile(__DIR__.'/resources/cnd/no-stop-at-eof.cnd'); $this->assertTrue(isset($res['namespaces'])); $this->assertEquals(array('phpcr' => 'http://www.doctrine-project.org/projects/phpcr_odm'), $res['namespaces']); @@ -154,7 +154,7 @@ public function testNoStopAtEofError() public function testBigFile() { //var_dump($this->session->getWorkspace()->getNodeTypeManager()->getNodeType('nt:file')->hasOrderableChildNodes());die; - $res = $this->cndParser->parseFile(__DIR__ . '/resources/cnd/jackrabbit_nodetypes.cnd'); + $res = $this->cndParser->parseFile(__DIR__.'/resources/cnd/jackrabbit_nodetypes.cnd'); // some random sanity checks $this->assertTrue(isset($res['nodeTypes'])); diff --git a/tests/PhpcrUtils/CndWriterTest.php b/tests/PhpcrUtils/CndWriterTest.php index f6a27aef..60bb08c5 100644 --- a/tests/PhpcrUtils/CndWriterTest.php +++ b/tests/PhpcrUtils/CndWriterTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/PhpcrUtils/PurgeTest.php b/tests/PhpcrUtils/PurgeTest.php index 362f828d..5d2b54de 100644 --- a/tests/PhpcrUtils/PurgeTest.php +++ b/tests/PhpcrUtils/PurgeTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/CharacterTest.php b/tests/Query/CharacterTest.php index 49458bd6..9ab20423 100644 --- a/tests/Query/CharacterTest.php +++ b/tests/Query/CharacterTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/NodeViewTest.php b/tests/Query/NodeViewTest.php index 84527dc3..9f2dbe22 100644 --- a/tests/Query/NodeViewTest.php +++ b/tests/Query/NodeViewTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/QOM/ConvertQueriesBackAndForthTest.php b/tests/Query/QOM/ConvertQueriesBackAndForthTest.php index a27efe99..3b88b80e 100644 --- a/tests/Query/QOM/ConvertQueriesBackAndForthTest.php +++ b/tests/Query/QOM/ConvertQueriesBackAndForthTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/QOM/QomTestQueries.php b/tests/Query/QOM/QomTestQueries.php index eed3786e..054454e4 100644 --- a/tests/Query/QOM/QomTestQueries.php +++ b/tests/Query/QOM/QomTestQueries.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/QOM/QomToSql2ConverterTest.php b/tests/Query/QOM/QomToSql2ConverterTest.php index d37b113a..8130c3c2 100644 --- a/tests/Query/QOM/QomToSql2ConverterTest.php +++ b/tests/Query/QOM/QomToSql2ConverterTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/QOM/Sql2ScannerTest.php b/tests/Query/QOM/Sql2ScannerTest.php index 94a544da..a8becee5 100644 --- a/tests/Query/QOM/Sql2ScannerTest.php +++ b/tests/Query/QOM/Sql2ScannerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/QOM/Sql2TestQueries.php b/tests/Query/QOM/Sql2TestQueries.php index ce6698d7..945b719d 100644 --- a/tests/Query/QOM/Sql2TestQueries.php +++ b/tests/Query/QOM/Sql2TestQueries.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/QOM/Sql2ToQomConverterTest.php b/tests/Query/QOM/Sql2ToQomConverterTest.php index 85e1847f..0530b848 100644 --- a/tests/Query/QOM/Sql2ToQomConverterTest.php +++ b/tests/Query/QOM/Sql2ToQomConverterTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/QueryBaseCase.php b/tests/Query/QueryBaseCase.php index b75e227f..44bc4c1c 100644 --- a/tests/Query/QueryBaseCase.php +++ b/tests/Query/QueryBaseCase.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/QueryManagerTest.php b/tests/Query/QueryManagerTest.php index 22d8b7f5..63e2353a 100644 --- a/tests/Query/QueryManagerTest.php +++ b/tests/Query/QueryManagerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/QueryObjectQOMTest.php b/tests/Query/QueryObjectQOMTest.php index 95540f8b..d48922ee 100644 --- a/tests/Query/QueryObjectQOMTest.php +++ b/tests/Query/QueryObjectQOMTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -40,7 +40,7 @@ public function setUp() try { $this->factory = $this->sharedFixture['qm']->getQOMFactory(); } catch (\Exception $e) { - $this->markTestSkipped('Can not get the QOM factory, skipping tests about QOM query. ' . $e->getMessage()); + $this->markTestSkipped('Can not get the QOM factory, skipping tests about QOM query. '.$e->getMessage()); } $source = $this->factory->selector('data', 'nt:folder'); @@ -81,7 +81,7 @@ public function testExecuteInvalid() public function testGetStatement() { - $this->assertEquals('SELECT * FROM [nt:folder] AS data ' . + $this->assertEquals('SELECT * FROM [nt:folder] AS data '. 'WHERE (ISDESCENDANTNODE(data, [/tests_general_base]) OR ISSAMENODE(data, [/tests_general_base]))', $this->query->getStatement()); } diff --git a/tests/Query/QueryObjectSql2Test.php b/tests/Query/QueryObjectSql2Test.php index 6df4fd6e..354355e9 100644 --- a/tests/Query/QueryObjectSql2Test.php +++ b/tests/Query/QueryObjectSql2Test.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/QueryResultsTest.php b/tests/Query/QueryResultsTest.php index e5a8f2b2..0e7675e6 100644 --- a/tests/Query/QueryResultsTest.php +++ b/tests/Query/QueryResultsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/QuerySql2OperationsTest.php b/tests/Query/QuerySql2OperationsTest.php index c1157b3c..7f354892 100644 --- a/tests/Query/QuerySql2OperationsTest.php +++ b/tests/Query/QuerySql2OperationsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/RowIteratorTest.php b/tests/Query/RowIteratorTest.php index ce8e9cbc..d0087ae4 100644 --- a/tests/Query/RowIteratorTest.php +++ b/tests/Query/RowIteratorTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/RowTest.php b/tests/Query/RowTest.php index 926dc668..3f28e7c5 100644 --- a/tests/Query/RowTest.php +++ b/tests/Query/RowTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/Sql1/QueryBaseCase.php b/tests/Query/Sql1/QueryBaseCase.php index fba7f7f5..ab839c56 100644 --- a/tests/Query/Sql1/QueryBaseCase.php +++ b/tests/Query/Sql1/QueryBaseCase.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/Sql1/QueryOperationsTest.php b/tests/Query/Sql1/QueryOperationsTest.php index 556bcfb2..5237cae5 100644 --- a/tests/Query/Sql1/QueryOperationsTest.php +++ b/tests/Query/Sql1/QueryOperationsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/XPath/QueryBaseCase.php b/tests/Query/XPath/QueryBaseCase.php index f4c42b5c..7a954da0 100644 --- a/tests/Query/XPath/QueryBaseCase.php +++ b/tests/Query/XPath/QueryBaseCase.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Query/XPath/QueryOperationsTest.php b/tests/Query/XPath/QueryOperationsTest.php index 5aa2ea45..51f126fa 100644 --- a/tests/Query/XPath/QueryOperationsTest.php +++ b/tests/Query/XPath/QueryOperationsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Reading/BinaryReadMethodsTest.php b/tests/Reading/BinaryReadMethodsTest.php index db1d5aee..57370f5f 100644 --- a/tests/Reading/BinaryReadMethodsTest.php +++ b/tests/Reading/BinaryReadMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Reading/EncodingTest.php b/tests/Reading/EncodingTest.php index b4f348b4..c0e5cdcc 100644 --- a/tests/Reading/EncodingTest.php +++ b/tests/Reading/EncodingTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Reading/JackalopeFetchDepthTest.php b/tests/Reading/JackalopeFetchDepthTest.php index 1b4dd3ee..58d678d1 100644 --- a/tests/Reading/JackalopeFetchDepthTest.php +++ b/tests/Reading/JackalopeFetchDepthTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Reading/NodeReadMethodsTest.php b/tests/Reading/NodeReadMethodsTest.php index 13f20d49..4a5a188f 100644 --- a/tests/Reading/NodeReadMethodsTest.php +++ b/tests/Reading/NodeReadMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Reading/PropertyReadMethodsTest.php b/tests/Reading/PropertyReadMethodsTest.php index 23ef6b02..0cb2cdc5 100644 --- a/tests/Reading/PropertyReadMethodsTest.php +++ b/tests/Reading/PropertyReadMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Reading/SessionNamespaceRemappingTest.php b/tests/Reading/SessionNamespaceRemappingTest.php index 6892bbd4..dc23af1f 100644 --- a/tests/Reading/SessionNamespaceRemappingTest.php +++ b/tests/Reading/SessionNamespaceRemappingTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Reading/SessionReadMethodsTest.php b/tests/Reading/SessionReadMethodsTest.php index e414357d..e5349d09 100644 --- a/tests/Reading/SessionReadMethodsTest.php +++ b/tests/Reading/SessionReadMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/SameNameSiblings/DeleteMethodsTest.php b/tests/SameNameSiblings/DeleteMethodsTest.php index f4118f1a..fc3b9fd5 100644 --- a/tests/SameNameSiblings/DeleteMethodsTest.php +++ b/tests/SameNameSiblings/DeleteMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -42,14 +42,14 @@ public function testRemoveItemMultiple() foreach ($childNames as $childName) { $this->assertTrue($parent->hasNode($childName)); - $this->session->removeItem($parentPath . '/' . $childName); + $this->session->removeItem($parentPath.'/'.$childName); $this->assertFalse($parent->hasNode($childName), 'Node was not removed'); } $this->saveAndRenewSession(); foreach ($childNames as $childName) { - $this->assertFalse($this->session->nodeExists($parentPath . '/' . $childName)); + $this->assertFalse($this->session->nodeExists($parentPath.'/'.$childName)); } } @@ -76,7 +76,7 @@ public function testRemoveNode() $this->saveAndRenewSession(); foreach ($childNames as $childName) { - $this->assertFalse($this->session->nodeExists($parentPath . '/' . $childName)); + $this->assertFalse($this->session->nodeExists($parentPath.'/'.$childName)); } } @@ -125,7 +125,7 @@ public function testDeleteManyNodes() } foreach ($childrenToDelete as $childName) { - $this->session->removeItem($parentPath . '/' . $childName); + $this->session->removeItem($parentPath.'/'.$childName); $this->assertFalse($parent->hasNode($childName), 'Node was not removed'); } @@ -136,7 +136,7 @@ public function testDeleteManyNodes() foreach ($parent->getNodes() as $node) { $child = each($childrenAtEnd); - $this->assertEquals($parentPath . '/' . $child['key'], $node->getPath()); + $this->assertEquals($parentPath.'/'.$child['key'], $node->getPath()); $this->assertEquals($child['value'], $node->getProperty('childNumber')->getValue()); } } diff --git a/tests/Transactions/TransactionMethodsTest.php b/tests/Transactions/TransactionMethodsTest.php index 92bcd562..aab5cb13 100644 --- a/tests/Transactions/TransactionMethodsTest.php +++ b/tests/Transactions/TransactionMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -44,7 +44,7 @@ public function testTransactionCommit() $utx->begin(); $child = $this->node->addNode('insideTransaction'); - $this->assertEquals($this->node->getPath() . '/insideTransaction', $child->getPath()); + $this->assertEquals($this->node->getPath().'/insideTransaction', $child->getPath()); $this->session->save(); @@ -61,7 +61,7 @@ public function testTransactionCommit() public function testTransactionRollback() { $copy = $this->node->addNode('copyTransaction'); - $copiedNodePath = $this->node->getPath() . '/copyTransactionCopy'; + $copiedNodePath = $this->node->getPath().'/copyTransactionCopy'; $this->session->save(); $utx = $this->session->getWorkspace()->getTransactionManager(); diff --git a/tests/Versioning/CreateVersionableNodeTest.php b/tests/Versioning/CreateVersionableNodeTest.php index ca7e87c0..108aa360 100644 --- a/tests/Versioning/CreateVersionableNodeTest.php +++ b/tests/Versioning/CreateVersionableNodeTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Versioning/NodeTypeReadTest.php b/tests/Versioning/NodeTypeReadTest.php index 32855405..fcfdd76b 100644 --- a/tests/Versioning/NodeTypeReadTest.php +++ b/tests/Versioning/NodeTypeReadTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Versioning/SimpleVersionTest.php b/tests/Versioning/SimpleVersionTest.php index 3a0676c2..b5091d85 100644 --- a/tests/Versioning/SimpleVersionTest.php +++ b/tests/Versioning/SimpleVersionTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Versioning/VersionHistoryTest.php b/tests/Versioning/VersionHistoryTest.php index 3059234d..cf4db720 100644 --- a/tests/Versioning/VersionHistoryTest.php +++ b/tests/Versioning/VersionHistoryTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Versioning/VersionManagerTest.php b/tests/Versioning/VersionManagerTest.php index 05e345d7..e2ab3048 100644 --- a/tests/Versioning/VersionManagerTest.php +++ b/tests/Versioning/VersionManagerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Versioning/VersionTest.php b/tests/Versioning/VersionTest.php index ba9fedc1..3ad8735d 100644 --- a/tests/Versioning/VersionTest.php +++ b/tests/Versioning/VersionTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/WorkspaceManagement/WorkspaceManagementTest.php b/tests/WorkspaceManagement/WorkspaceManagementTest.php index 2f80ad69..1ce873ad 100644 --- a/tests/WorkspaceManagement/WorkspaceManagementTest.php +++ b/tests/WorkspaceManagement/WorkspaceManagementTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -16,7 +16,7 @@ class WorkspaceManagementTest extends \PHPCR\Test\BaseCase { public function testCreateWorkspace() { - $workspacename = 'test' . time(); + $workspacename = 'test'.time(); $workspace = $this->session->getWorkspace(); $workspace->createWorkspace($workspacename); @@ -38,7 +38,7 @@ public function testCreateWorkspaceExisting($workspacename) public function testCreateWorkspaceWithSource() { - $workspacename = 'testWithSource' . time(); + $workspacename = 'testWithSource'.time(); $workspace = $this->session->getWorkspace(); $workspace->createWorkspace($workspacename, $workspace->getName()); @@ -52,7 +52,7 @@ public function testCreateWorkspaceWithSource() */ public function testCreateWorkspaceWithInvalidSource() { - $workspacename = 'testWithSource' . time(); + $workspacename = 'testWithSource'.time(); $workspace = $this->session->getWorkspace(); $workspace->createWorkspace($workspacename, 'thisworkspaceisnotexisting'); } diff --git a/tests/Writing/AddMethodsTest.php b/tests/Writing/AddMethodsTest.php index a3c34b1f..6a4e96d6 100644 --- a/tests/Writing/AddMethodsTest.php +++ b/tests/Writing/AddMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -40,25 +40,25 @@ public function testAddNode() // should take the primaryType $new = $this->node->addNode('newNode'); - $this->assertNotNull($this->session->getNode($this->node->getPath() . '/newNode'), 'Node newNode was not created'); + $this->assertNotNull($this->session->getNode($this->node->getPath().'/newNode'), 'Node newNode was not created'); $this->session->save(); $this->assertFalse($new->isNew(), 'Node was not saved'); $this->renewSession(); - $this->assertNotNull($this->session->getNode($this->node->getPath() . '/newNode'), 'Node newNode was not properly saved'); + $this->assertNotNull($this->session->getNode($this->node->getPath().'/newNode'), 'Node newNode was not properly saved'); } public function testAddNodeWithPath() { $new = $this->node->addNode('test:namespacedNode/newNode', 'nt:unstructured'); - $this->assertNotNull($this->session->getNode($this->node->getPath() . '/test:namespacedNode/newNode'), 'Node newNode was not created'); + $this->assertNotNull($this->session->getNode($this->node->getPath().'/test:namespacedNode/newNode'), 'Node newNode was not created'); $this->session->save(); $this->assertFalse($new->isNew(), 'Node was not saved'); $this->renewSession(); - $this->assertNotNull($this->session->getNode($this->node->getPath() . '/test:namespacedNode/newNode'), 'Node newNode was not properly saved'); + $this->assertNotNull($this->session->getNode($this->node->getPath().'/test:namespacedNode/newNode'), 'Node newNode was not properly saved'); } public function testAddNodeFileType() @@ -77,7 +77,7 @@ public function testAddNodeFileType() $this->renewSession(); - $newNode = $this->session->getNode($path . '/newFileNode'); + $newNode = $this->session->getNode($path.'/newFileNode'); $this->assertNotNull($newNode, 'Node newFileNode was not created'); $this->assertEquals('nt:file', $newNode->getPrimaryNodeType()->getName(), 'Node newFileNode was not created'); $lastModified = $newNode->getNode('jcr:content')->getPropertyValue('jcr:lastModified'); @@ -88,13 +88,13 @@ public function testAddNodeFileType() public function testAddNodeUnstructuredType() { $new = $this->node->addNode('newUnstructuredNode', 'nt:unstructured'); - $this->assertNotNull($this->session->getNode($this->node->getPath() . '/newUnstructuredNode'), 'Node newUnstructuredNode was not created'); + $this->assertNotNull($this->session->getNode($this->node->getPath().'/newUnstructuredNode'), 'Node newUnstructuredNode was not created'); $this->session->save(); $this->assertFalse($new->isNew(), 'Node was not saved'); $this->renewSession(); - $this->assertNotNull($this->session->getNode($this->node->getPath() . '/newUnstructuredNode'), 'Node newUnstructuredNode was not created'); + $this->assertNotNull($this->session->getNode($this->node->getPath().'/newUnstructuredNode'), 'Node newUnstructuredNode was not created'); } /** @@ -121,7 +121,7 @@ public function testAddNodeAutoNamedEmptyNamehint() $this->renewSession(); - $this->assertNotNull($this->session->getNode($this->node->getPath() . '/jcr:content/' . $name), 'Node newNode was not properly saved'); + $this->assertNotNull($this->session->getNode($this->node->getPath().'/jcr:content/'.$name), 'Node newNode was not properly saved'); } public function testAddNodeAutoNamedNullNamehint() @@ -139,7 +139,7 @@ public function testAddNodeAutoNamedNullNamehint() $this->renewSession(); - $this->assertNotNull($this->session->getNode($this->node->getPath() . '/jcr:content/' . $name), 'Node newNode was not properly saved'); + $this->assertNotNull($this->session->getNode($this->node->getPath().'/jcr:content/'.$name), 'Node newNode was not properly saved'); } public function testAddNodeAutoNamedValidNamespaceNamehint() @@ -158,7 +158,7 @@ public function testAddNodeAutoNamedValidNamespaceNamehint() $this->renewSession(); - $this->assertNotNull($this->session->getNode($this->node->getPath() . '/jcr:content/' . $name), 'Node newNode was not properly saved'); + $this->assertNotNull($this->session->getNode($this->node->getPath().'/jcr:content/'.$name), 'Node newNode was not properly saved'); } public function testAddPropertyOnUnstructured() @@ -172,7 +172,7 @@ public function testAddPropertyOnUnstructured() $this->assertFalse($node->isNew(), 'Node was not saved'); $this->renewSession(); - $node = $this->session->getNode($path . '/unstructuredNode'); + $node = $this->session->getNode($path.'/unstructuredNode'); $this->assertNotNull($node, 'Node was not created'); $this->assertEquals('val', $node->getPropertyValue('testprop'), 'Property was not saved correctly'); @@ -183,7 +183,7 @@ public function testAddPropertyOnUnstructured() $this->assertFalse($node->isNew(), 'Node was not saved'); $this->assertFalse($node->getProperty('test2')->isNew(), 'Property was not saved'); $this->renewSession(); - $node = $this->session->getNode($path . '/unstructuredNode'); + $node = $this->session->getNode($path.'/unstructuredNode'); $this->assertEquals('val2', $node->getPropertyValue('test2'), 'Property was not added correctly'); } @@ -199,7 +199,7 @@ public function testAddMultiValuePropertyOnUnstructured() $this->assertFalse($node->isNew(), 'Node was not saved'); $this->renewSession(); - $node = $this->session->getNode($path . '/unstructuredNode2'); + $node = $this->session->getNode($path.'/unstructuredNode2'); $this->assertNotNull($node, 'Node was not created'); $this->assertEquals(array('val', 'val2'), $node->getPropertyValue('test'), 'Property was not saved correctly'); @@ -210,7 +210,7 @@ public function testAddMultiValuePropertyOnUnstructured() $this->assertFalse($node->isNew(), 'Node was not saved'); $this->assertFalse($node->getProperty('test2')->isNew(), 'Property was not saved'); $this->renewSession(); - $node = $this->session->getNode($path . '/unstructuredNode2'); + $node = $this->session->getNode($path.'/unstructuredNode2'); $this->assertEquals(array('val3', 'val4'), $node->getPropertyValue('test2'), 'Property was not added correctly'); } @@ -371,7 +371,7 @@ public function testAddNodeWithUnregisteredNamespace() $nodeName = 'child'; //add the node with an unregistered namespace, should throw a RepositoryException - $this->node->addNode($namespace . ':' . $nodeName, 'nt:unstructured'); + $this->node->addNode($namespace.':'.$nodeName, 'nt:unstructured'); //save the changes $this->saveAndRenewSession(); @@ -388,7 +388,7 @@ public function testAddPropertyWithUnregisteredNamespace() $propertyName = 'prop'; //add a property with an unregistered namespace, should throw a RepositoryException - $this->node->setProperty($namespace . ':' . $propertyName, 'some value'); + $this->node->setProperty($namespace.':'.$propertyName, 'some value'); //save the changes $this->saveAndRenewSession(); @@ -401,25 +401,25 @@ public function testAddNodeWithAutoCreatedNode() } $workspace = $this->session->getWorkspace(); - $cnd = file_get_contents(__DIR__ . '/../../fixtures/10_Writing/add_auto_create.cnd'); + $cnd = file_get_contents(__DIR__.'/../../fixtures/10_Writing/add_auto_create.cnd'); $workspace->getNodeTypeManager()->registerNodeTypesCnd($cnd, true); $this->node->addNode('foo', 'test:testautocreate'); $this->session->save(); - $childNode = $this->session->getNode($this->node->getPath() . '/foo'); + $childNode = $this->session->getNode($this->node->getPath().'/foo'); $this->assertNotNull($childNode); - $childNode = $this->session->getNode($this->node->getPath() . '/foo/autocreated'); + $childNode = $this->session->getNode($this->node->getPath().'/foo/autocreated'); $this->assertNotNull($childNode); $primaryType = $childNode->getPrimaryNodeType(); $this->assertEquals('nt:unstructured', $primaryType->getName()); - $childNode = $this->session->getNode($this->node->getPath() . '/foo/autocreatedwithchild'); + $childNode = $this->session->getNode($this->node->getPath().'/foo/autocreatedwithchild'); $this->assertNotNull($childNode); $primaryType = $childNode->getPrimaryNodeType(); $this->assertEquals('test:testAutoCreateChild', $primaryType->getName()); - $childNode = $this->session->getNode($this->node->getPath() . '/foo/autocreatedwithchild/foo'); + $childNode = $this->session->getNode($this->node->getPath().'/foo/autocreatedwithchild/foo'); $this->assertNotNull($childNode); $primaryType = $childNode->getPrimaryNodeType(); $this->assertEquals('nt:unstructured', $primaryType->getName()); diff --git a/tests/Writing/CloneMethodsTest.php b/tests/Writing/CloneMethodsTest.php index cc643734..be61d6eb 100644 --- a/tests/Writing/CloneMethodsTest.php +++ b/tests/Writing/CloneMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -72,7 +72,7 @@ public function testCloneReferenceableWithChild() { $srcNode = '/tests_write_manipulation_clone/testWorkspaceClone/referenceable'; $dstNode = $srcNode; - $dstChildNode = $dstNode . '/cloneChild'; + $dstChildNode = $dstNode.'/cloneChild'; $destSession = self::$destWs->getSession(); self::$destWs->cloneFrom($this->srcWsName, $srcNode, $dstNode, false); @@ -456,10 +456,10 @@ public function testUpdateNodeWithChildren() { $srcNode = '/tests_write_manipulation_clone/testWorkspaceUpdateNode/sourceNode'; $dstNode = '/tests_write_manipulation_clone/testWorkspaceUpdateNode/destNode'; - $srcChildNode = $srcNode . '/cloneChild'; - $dstChildNode = $dstNode . '/cloneChild'; - $srcChildOfChildNode = $srcChildNode . '/childOfChild'; - $dstChildOfChildNode = $dstChildNode . '/childOfChild'; + $srcChildNode = $srcNode.'/cloneChild'; + $dstChildNode = $dstNode.'/cloneChild'; + $srcChildOfChildNode = $srcChildNode.'/childOfChild'; + $dstChildOfChildNode = $dstChildNode.'/childOfChild'; $destSession = self::$destWs->getSession(); $sourceSession = $this->srcWs->getSession(); @@ -558,7 +558,7 @@ public function testUpdateSrcNotFound() try { $clonedNode->update($this->srcWsName); } catch (\Exception $exception) { - $this->fail("'update' method should not raise an error when source not found, got error: " . $exception->getMessage()); + $this->fail("'update' method should not raise an error when source not found, got error: ".$exception->getMessage()); } $destSession->refresh(false); diff --git a/tests/Writing/CombinedManipulationsTest.php b/tests/Writing/CombinedManipulationsTest.php index 678c3a00..9d482b40 100644 --- a/tests/Writing/CombinedManipulationsTest.php +++ b/tests/Writing/CombinedManipulationsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -297,14 +297,14 @@ public function testRemoveAndAddAndRemoveToplevelNode() */ public function testRemoveAndMove() { - $node = $this->session->getNode($this->node->getPath() . '/parent/child'); + $node = $this->session->getNode($this->node->getPath().'/parent/child'); $path = $node->getPath(); $this->assertInstanceOf('PHPCR\NodeType\NodeTypeInterface', $node->getPrimaryNodeType()); $this->assertSame('nt:unstructured', $node->getPrimaryNodeType()->getName()); $node->remove(); $this->assertFalse($this->session->nodeExists($path)); - $this->session->move($this->node->getPath() . '/other', $path); + $this->session->move($this->node->getPath().'/other', $path); $this->assertTrue($this->session->nodeExists($path)); $parent = $this->node->getNode('parent'); $this->assertTrue($parent->hasNode('child')); @@ -520,14 +520,14 @@ public function testRemoveSessionRefresh() $child = $node->getNode('child'); $child->remove(); $this->assertFalse($node->hasNode('child')); - $this->assertFalse($this->session->nodeExists($node->getPath() . '/child')); + $this->assertFalse($this->session->nodeExists($node->getPath().'/child')); $this->session->refresh(false); $this->assertFalse($this->session->hasPendingChanges()); $this->assertEquals('Old', $node->getPropertyValue('prop')); $this->assertTrue($node->hasNode('child')); - $this->assertTrue($this->session->nodeExists($node->getPath() . '/child')); - $this->assertSame($child, $this->session->getNode($node->getPath() . '/child')); + $this->assertTrue($this->session->nodeExists($node->getPath().'/child')); + $this->assertSame($child, $this->session->getNode($node->getPath().'/child')); } public function testRemoveSessionRefreshKeepChanges() @@ -537,31 +537,31 @@ public function testRemoveSessionRefreshKeepChanges() $node->setProperty('prop', null); $this->assertFalse($node->hasProperty('prop')); - $this->assertFalse($this->session->propertyExists($node->getPath() . '/prop')); + $this->assertFalse($this->session->propertyExists($node->getPath().'/prop')); $child = $node->getNode('child'); $child->remove(); $this->assertFalse($node->hasNode('child')); - $this->assertFalse($this->session->nodeExists($node->getPath() . '/child')); + $this->assertFalse($this->session->nodeExists($node->getPath().'/child')); $this->session->refresh(true); $this->assertTrue($this->session->hasPendingChanges()); $this->assertFalse($node->hasProperty('prop')); - $this->assertFalse($this->session->propertyExists($node->getPath() . '/prop')); + $this->assertFalse($this->session->propertyExists($node->getPath().'/prop')); $this->assertFalse($node->hasNode('child')); - $this->assertFalse($this->session->nodeExists($node->getPath() . '/child')); + $this->assertFalse($this->session->nodeExists($node->getPath().'/child')); $this->session->save(); $this->assertFalse($node->hasProperty('prop')); - $this->assertFalse($this->session->propertyExists($node->getPath() . '/prop')); + $this->assertFalse($this->session->propertyExists($node->getPath().'/prop')); $this->assertFalse($node->hasNode('child')); - $this->assertFalse($this->session->nodeExists($node->getPath() . '/child')); + $this->assertFalse($this->session->nodeExists($node->getPath().'/child')); $session = $this->renewSession(); $node = $session->getNode($path); $this->assertFalse($node->hasProperty('prop')); - $this->assertFalse($session->propertyExists($node->getPath() . '/prop')); + $this->assertFalse($session->propertyExists($node->getPath().'/prop')); $this->assertFalse($node->hasNode('child')); - $this->assertFalse($session->nodeExists($node->getPath() . '/child')); + $this->assertFalse($session->nodeExists($node->getPath().'/child')); } /** @@ -573,7 +573,7 @@ public function testRemoveOtherSessionRefreshKeepChanges() $node = $this->node; $path = $node->getPath(); $child = $node->getNode('childnode'); - $childprop = $this->session->getProperty($node->getPath() . '/child/childprop'); + $childprop = $this->session->getProperty($node->getPath().'/child/childprop'); $node->setProperty('newprop', 'Value'); @@ -623,18 +623,18 @@ public function testMoveSessionRefresh() $node = $this->node; $child = $node->getNode('src/child'); - $this->session->move($node->getPath() . '/src/child', $node->getPath() . '/target/childnew'); + $this->session->move($node->getPath().'/src/child', $node->getPath().'/target/childnew'); - $this->assertFalse($this->session->nodeExists($node->getPath() . '/src/child')); - $this->assertTrue($this->session->nodeExists($node->getPath() . '/target/childnew')); + $this->assertFalse($this->session->nodeExists($node->getPath().'/src/child')); + $this->assertTrue($this->session->nodeExists($node->getPath().'/target/childnew')); $this->assertTrue($this->session->hasPendingChanges()); $this->session->refresh(false); $this->assertFalse($this->session->hasPendingChanges()); - $this->assertTrue($this->session->nodeExists($node->getPath() . '/src/child')); - $this->assertFalse($this->session->nodeExists($node->getPath() . '/target/childnew')); - $this->assertEquals($node->getPath() . '/src/child', $child->getPath()); + $this->assertTrue($this->session->nodeExists($node->getPath().'/src/child')); + $this->assertFalse($this->session->nodeExists($node->getPath().'/target/childnew')); + $this->assertEquals($node->getPath().'/src/child', $child->getPath()); $src = $node->getNode('src'); $this->assertTrue($src->hasNode('child')); $this->assertSame($child, $src->getNode('child')); @@ -648,17 +648,17 @@ public function testMoveSessionRefreshKeepChanges() $path = $node->getPath(); $child = $node->getNode('src/child'); - $this->session->move($node->getPath() . '/src/child', $node->getPath() . '/target/childnew'); + $this->session->move($node->getPath().'/src/child', $node->getPath().'/target/childnew'); - $this->assertFalse($this->session->nodeExists($node->getPath() . '/src/child')); - $this->assertTrue($this->session->nodeExists($node->getPath() . '/target/childnew')); + $this->assertFalse($this->session->nodeExists($node->getPath().'/src/child')); + $this->assertTrue($this->session->nodeExists($node->getPath().'/target/childnew')); $this->session->refresh(true); $this->assertTrue($this->session->hasPendingChanges()); - $this->assertFalse($this->session->nodeExists($node->getPath() . '/src/child')); - $this->assertTrue($this->session->nodeExists($node->getPath() . '/target/childnew')); - $this->assertEquals($node->getPath() . '/target/childnew', $child->getPath()); + $this->assertFalse($this->session->nodeExists($node->getPath().'/src/child')); + $this->assertTrue($this->session->nodeExists($node->getPath().'/target/childnew')); + $this->assertEquals($node->getPath().'/target/childnew', $child->getPath()); $src = $node->getNode('src'); $this->assertFalse($src->hasNode('child')); $target = $node->getNode('target'); @@ -666,9 +666,9 @@ public function testMoveSessionRefreshKeepChanges() $this->assertSame($child, $target->getNode('childnew')); $this->session->save(); - $this->assertFalse($this->session->nodeExists($node->getPath() . '/src/child')); - $this->assertTrue($this->session->nodeExists($node->getPath() . '/target/childnew')); - $this->assertEquals($node->getPath() . '/target/childnew', $child->getPath()); + $this->assertFalse($this->session->nodeExists($node->getPath().'/src/child')); + $this->assertTrue($this->session->nodeExists($node->getPath().'/target/childnew')); + $this->assertEquals($node->getPath().'/target/childnew', $child->getPath()); $src = $node->getNode('src'); $this->assertFalse($src->hasNode('child')); $target = $node->getNode('target'); @@ -677,9 +677,9 @@ public function testMoveSessionRefreshKeepChanges() $session = $this->renewSession(); $node = $session->getNode($path); - $this->assertFalse($session->nodeExists($node->getPath() . '/src/child')); - $this->assertTrue($session->nodeExists($node->getPath() . '/target/childnew')); - $this->assertEquals($node->getPath() . '/target/childnew', $child->getPath()); + $this->assertFalse($session->nodeExists($node->getPath().'/src/child')); + $this->assertTrue($session->nodeExists($node->getPath().'/target/childnew')); + $this->assertEquals($node->getPath().'/target/childnew', $child->getPath()); $src = $node->getNode('src'); $this->assertFalse($src->hasNode('child')); $target = $node->getNode('target'); @@ -698,8 +698,8 @@ public function testAddSessionRefresh() $this->assertFalse($node->hasNode('child')); $this->assertFalse($node->hasProperty('prop')); - $this->assertFalse($this->session->nodeExists($node->getPath() . '/child')); - $this->assertFalse($this->session->propertyExists($node->getPath() . '/prop')); + $this->assertFalse($this->session->nodeExists($node->getPath().'/child')); + $this->assertFalse($this->session->propertyExists($node->getPath().'/prop')); $this->setExpectedException('\PHPCR\PathNotFoundException'); $node->getNode('child'); @@ -720,8 +720,8 @@ public function testAddSessionRefreshKeepChanges() $this->assertTrue($node->hasProperty('prop')); $this->assertSame($property, $node->getProperty('prop')); - $this->assertTrue($this->session->nodeExists($node->getPath() . '/child')); - $this->assertTrue($this->session->propertyExists($node->getPath() . '/prop')); + $this->assertTrue($this->session->nodeExists($node->getPath().'/child')); + $this->assertTrue($this->session->propertyExists($node->getPath().'/prop')); $this->session->save(); $this->assertTrue($node->hasNode('child')); @@ -729,8 +729,8 @@ public function testAddSessionRefreshKeepChanges() $this->assertTrue($node->hasProperty('prop')); $this->assertSame($property, $node->getProperty('prop')); - $this->assertTrue($this->session->nodeExists($node->getPath() . '/child')); - $this->assertTrue($this->session->propertyExists($node->getPath() . '/prop')); + $this->assertTrue($this->session->nodeExists($node->getPath().'/child')); + $this->assertTrue($this->session->propertyExists($node->getPath().'/prop')); $session = $this->renewSession(); $node = $session->getNode($path); @@ -740,8 +740,8 @@ public function testAddSessionRefreshKeepChanges() $this->assertTrue($node->hasProperty('prop')); $this->assertSame('Test', $node->getPropertyValue('prop')); - $this->assertTrue($session->nodeExists($node->getPath() . '/child')); - $this->assertTrue($session->propertyExists($node->getPath() . '/prop')); + $this->assertTrue($session->nodeExists($node->getPath().'/child')); + $this->assertTrue($session->propertyExists($node->getPath().'/prop')); } public function testNodeRevert() @@ -758,8 +758,8 @@ public function testNodeRevert() $this->assertSame('Old', $existingProperty->getValue()); $this->assertFalse($node->hasNode('child')); $this->assertFalse($node->hasProperty('other')); - $this->assertFalse($this->session->nodeExists($node->getPath() . '/child')); - $this->assertFalse($this->session->propertyExists($node->getPath() . '/other')); + $this->assertFalse($this->session->nodeExists($node->getPath().'/child')); + $this->assertFalse($this->session->propertyExists($node->getPath().'/other')); $this->setExpectedException('\PHPCR\PathNotFoundException'); $node->getPropertyValue('other'); diff --git a/tests/Writing/CopyMethodsTest.php b/tests/Writing/CopyMethodsTest.php index 43b68004..2094e8a5 100644 --- a/tests/Writing/CopyMethodsTest.php +++ b/tests/Writing/CopyMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -62,7 +62,7 @@ public function testWorkspaceCopy() $dchild = $this->session->getNode("$dst/srcFile"); $this->assertNotEquals($schild->getIdentifier(), $dchild->getIdentifier()); - $this->assertTrue($this->session->nodeExists($dst . '/srcFile/jcr:content'), 'Did not copy the whole subgraph'); + $this->assertTrue($this->session->nodeExists($dst.'/srcFile/jcr:content'), 'Did not copy the whole subgraph'); $sfile = $this->session->getNode("$src/srcFile/jcr:content"); $dfile = $this->session->getNode("$dst/srcFile/jcr:content"); diff --git a/tests/Writing/DeleteMethodsTest.php b/tests/Writing/DeleteMethodsTest.php index 745b4d2b..26549781 100644 --- a/tests/Writing/DeleteMethodsTest.php +++ b/tests/Writing/DeleteMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -43,11 +43,11 @@ public function testRemoveItemNode() $this->session->removeItem($this->node->getPath()); $this->assertFalse($parent->hasNode('testRemoveItemNode'), 'Node was not removed'); - $this->assertFalse($this->session->nodeExists($parent->getPath() . '/testRemoveItemNode')); + $this->assertFalse($this->session->nodeExists($parent->getPath().'/testRemoveItemNode')); $this->saveAndRenewSession(); - $this->assertFalse($this->session->nodeExists($parent->getPath() . '/testRemoveItemNode')); + $this->assertFalse($this->session->nodeExists($parent->getPath().'/testRemoveItemNode')); } /** @@ -135,19 +135,19 @@ public function testRemoveNodeParentState() { //relies on the base class setup trick to have the node populated from the fixtures $this->assertInstanceOf('PHPCR\NodeInterface', $this->node); - $path = $this->node->getPath() . '/parent/child'; + $path = $this->node->getPath().'/parent/child'; $child = $this->session->getNode($path); $child->remove(); - $parent = $this->session->getNode($this->node->getPath() . '/parent'); + $parent = $this->session->getNode($this->node->getPath().'/parent'); $this->assertFalse($parent->hasNode('child')); $this->assertFalse($this->session->nodeExists($path)); $session = $this->saveAndRenewSession(); $this->assertFalse($session->nodeExists($path)); - $parent = $session->getNode($this->node->getPath() . '/parent'); + $parent = $session->getNode($this->node->getPath().'/parent'); $this->assertFalse($parent->hasNode('child')); } @@ -388,7 +388,7 @@ public function testDeleteCascade() $items = array($this->node, $ptest, $prop, $child, $childprop, $childchild, $childchildprop); foreach ($items as $item) { try { - $this->fail('Should not be able to get path of deleted item ' . $item->getPath()); // this should explode + $this->fail('Should not be able to get path of deleted item '.$item->getPath()); // this should explode } catch (\PHPCR\InvalidItemStateException $e) { // the exception is expected } @@ -406,7 +406,7 @@ public function testDeleteCascade() foreach ($items as $item) { try { - $this->fail('Should not be able to get path of deleted item ' . $item->getPath()); // this should explode + $this->fail('Should not be able to get path of deleted item '.$item->getPath()); // this should explode } catch (\PHPCR\InvalidItemStateException $e) { // the exception is expected } @@ -540,8 +540,8 @@ public function testWorkspaceDelete() // Session $this->assertFalse($this->session->nodeExists($path)); - $this->assertFalse($this->session->nodeExists($path . '/child')); - $this->assertFalse($this->session->propertyExists($path . '/child/prop')); + $this->assertFalse($this->session->nodeExists($path.'/child')); + $this->assertFalse($this->session->propertyExists($path.'/child/prop')); try { $this->node->getPath(); $this->fail('Node was not notified that it is deleted'); @@ -558,7 +558,7 @@ public function testWorkspaceDelete() // Backend $this->session = $this->saveAndRenewSession(); $this->assertFalse($this->session->nodeExists($path)); - $this->assertFalse($this->session->nodeExists($path . '/child')); + $this->assertFalse($this->session->nodeExists($path.'/child')); } public function testWorkspaceDeleteProperty() diff --git a/tests/Writing/EncodingTest.php b/tests/Writing/EncodingTest.php index 4728c3d3..78148362 100644 --- a/tests/Writing/EncodingTest.php +++ b/tests/Writing/EncodingTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Writing/ItemStateTest.php b/tests/Writing/ItemStateTest.php index d714b834..b3b4215a 100644 --- a/tests/Writing/ItemStateTest.php +++ b/tests/Writing/ItemStateTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Writing/LastModifiedTest.php b/tests/Writing/LastModifiedTest.php index 32199ba1..90361b60 100644 --- a/tests/Writing/LastModifiedTest.php +++ b/tests/Writing/LastModifiedTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Writing/LastModifiedUpdateTest.php b/tests/Writing/LastModifiedUpdateTest.php index 3916c7da..336cf0f6 100644 --- a/tests/Writing/LastModifiedUpdateTest.php +++ b/tests/Writing/LastModifiedUpdateTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Writing/MixinCreatedTest.php b/tests/Writing/MixinCreatedTest.php index 5e492e5a..a9624421 100644 --- a/tests/Writing/MixinCreatedTest.php +++ b/tests/Writing/MixinCreatedTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -44,7 +44,7 @@ public function testCreationNode() $this->assertInstanceOf('DateTime', $date); /* @var $date \DateTime */ $diff = time() - $date->getTimestamp(); - $this->assertTrue($diff < 60 * 10, 'jcr:created should be current date as fixture was just imported: ' . $date->format('c')); + $this->assertTrue($diff < 60 * 10, 'jcr:created should be current date as fixture was just imported: '.$date->format('c')); // Re-read the node to be sure things got properly saved $this->renewSession(); @@ -55,6 +55,6 @@ public function testCreationNode() $date = $child->getPropertyValue('jcr:created'); $this->assertInstanceOf('DateTime', $date); $diff = time() - $date->getTimestamp(); - $this->assertTrue($diff < 60 * 10, 'jcr:created should be current date as fixture was just imported: ' . $date->format('c')); + $this->assertTrue($diff < 60 * 10, 'jcr:created should be current date as fixture was just imported: '.$date->format('c')); } } diff --git a/tests/Writing/MixinReferenceableTest.php b/tests/Writing/MixinReferenceableTest.php index aad045a4..6a3374b7 100644 --- a/tests/Writing/MixinReferenceableTest.php +++ b/tests/Writing/MixinReferenceableTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Writing/MoveMethodsTest.php b/tests/Writing/MoveMethodsTest.php index 63ad4371..0576a404 100644 --- a/tests/Writing/MoveMethodsTest.php +++ b/tests/Writing/MoveMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -44,8 +44,8 @@ public function testNodeRename() $child = $first->getNode('child'); $first->rename('otherName'); - $this->assertEquals($this->node->getPath() . '/otherName', $first->getPath()); - $this->assertEquals($first->getPath() . '/child', $child->getPath()); + $this->assertEquals($this->node->getPath().'/otherName', $first->getPath()); + $this->assertEquals($first->getPath().'/child', $child->getPath()); $session = $this->saveAndRenewSession(); @@ -65,7 +65,7 @@ public function testSessionMove() // Session $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [S]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [S]'); - $this->assertTrue($this->session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [S]'); + $this->assertTrue($this->session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [S]'); $dstNode = $this->session->getNode($dst); $this->assertInstanceOf('PHPCR\NodeInterface', $dstNode); @@ -73,13 +73,13 @@ public function testSessionMove() $this->session->save(); $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($this->session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [B]'); + $this->assertTrue($this->session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [B]'); // Backend $session = $this->renewSession(); $this->assertTrue($session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [B]'); + $this->assertTrue($session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [B]'); } /** @@ -106,16 +106,16 @@ public function testSessionMoveSimilarSiblings() // Session $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [S]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [S]'); - $this->assertTrue($this->session->nodeExists($dst . '/another'), 'Destination child node not found [S]'); - $this->assertFalse($this->session->nodeExists($src . '/another'), 'Source child node still exists [S]'); + $this->assertTrue($this->session->nodeExists($dst.'/another'), 'Destination child node not found [S]'); + $this->assertFalse($this->session->nodeExists($src.'/another'), 'Source child node still exists [S]'); $this->assertTrue($this->session->nodeExists($probSrc), 'Sibling nodes should\'nt be moved'); $this->assertFalse($this->session->nodeExists($probDst), 'Sibling nodes should\'nt be moved'); $this->session->save(); $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($this->session->nodeExists($dst . '/another'), 'Destination child node not found [B]'); - $this->assertFalse($this->session->nodeExists($src . '/another'), 'Source child node still exists [B]'); + $this->assertTrue($this->session->nodeExists($dst.'/another'), 'Destination child node not found [B]'); + $this->assertFalse($this->session->nodeExists($src.'/another'), 'Source child node still exists [B]'); $this->assertTrue($this->session->nodeExists($probSrc), 'Sibling nodes should\'nt be moved'); $this->assertFalse($this->session->nodeExists($probDst), 'Sibling nodes should\'nt be moved'); @@ -123,8 +123,8 @@ public function testSessionMoveSimilarSiblings() $session = $this->renewSession(); $this->assertTrue($session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($session->nodeExists($dst . '/another'), 'Destination child node not found [B]'); - $this->assertFalse($session->nodeExists($src . '/another'), 'Source child node still exists [B]'); + $this->assertTrue($session->nodeExists($dst.'/another'), 'Destination child node not found [B]'); + $this->assertFalse($session->nodeExists($src.'/another'), 'Source child node still exists [B]'); $this->assertTrue($session->nodeExists($probSrc), 'Sibling nodes should\'nt be moved'); $this->assertFalse($session->nodeExists($probDst), 'Sibling nodes should\'nt be moved'); } @@ -156,16 +156,16 @@ public function testSessionMoveSimilarSiblingsInMemory() // Session $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [S]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [S]'); - $this->assertTrue($this->session->nodeExists($dst . '/another'), 'Destination child node not found [S]'); - $this->assertFalse($this->session->nodeExists($src . '/another'), 'Source child node still exists [S]'); + $this->assertTrue($this->session->nodeExists($dst.'/another'), 'Destination child node not found [S]'); + $this->assertFalse($this->session->nodeExists($src.'/another'), 'Source child node still exists [S]'); $this->assertTrue($this->session->nodeExists($probSrc), 'Sibling nodes should\'nt be moved'); $this->assertFalse($this->session->nodeExists($probDst), 'Sibling nodes should\'nt be moved'); $this->session->save(); $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($this->session->nodeExists($dst . '/another'), 'Destination child node not found [B]'); - $this->assertFalse($this->session->nodeExists($src . '/another'), 'Source child node still exists [B]'); + $this->assertTrue($this->session->nodeExists($dst.'/another'), 'Destination child node not found [B]'); + $this->assertFalse($this->session->nodeExists($src.'/another'), 'Source child node still exists [B]'); $this->assertTrue($this->session->nodeExists($probSrc), 'Sibling nodes should\'nt be moved'); $this->assertFalse($this->session->nodeExists($probDst), 'Sibling nodes should\'nt be moved'); @@ -173,8 +173,8 @@ public function testSessionMoveSimilarSiblingsInMemory() $session = $this->renewSession(); $this->assertTrue($session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($session->nodeExists($dst . '/another'), 'Destination child node not found [B]'); - $this->assertFalse($session->nodeExists($src . '/another'), 'Source child node still exists [B]'); + $this->assertTrue($session->nodeExists($dst.'/another'), 'Destination child node not found [B]'); + $this->assertFalse($session->nodeExists($src.'/another'), 'Source child node still exists [B]'); $this->assertTrue($session->nodeExists($probSrc), 'Sibling nodes should\'nt be moved'); $this->assertFalse($session->nodeExists($probDst), 'Sibling nodes should\'nt be moved'); } @@ -189,7 +189,7 @@ public function testSessionMoveWhitespace() // Session $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [S]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [S]'); - $this->assertTrue($this->session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [S]'); + $this->assertTrue($this->session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [S]'); $dstNode = $this->session->getNode($dst); $this->assertInstanceOf('PHPCR\NodeInterface', $dstNode); @@ -197,13 +197,13 @@ public function testSessionMoveWhitespace() $this->session->save(); $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($this->session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [B]'); + $this->assertTrue($this->session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [B]'); // Backend $session = $this->renewSession(); $this->assertTrue($session->nodeExists($dst), 'Destination node not found [B]'); $this->assertFalse($session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($session->nodeExists($dst . '/srcFile/jcr:content'), 'Destination child node not found [B]'); + $this->assertTrue($session->nodeExists($dst.'/srcFile/jcr:content'), 'Destination child node not found [B]'); } /** @@ -211,7 +211,7 @@ public function testSessionMoveWhitespace() */ public function testSessionMoveReferenceable() { - $dst = $this->node->getPath() . '/dstNode/srcNode'; + $dst = $this->node->getPath().'/dstNode/srcNode'; $node = $this->node->getNode('srcNode'); $srcUuid = $node->getIdentifier(); $src = $node->getPath(); @@ -256,14 +256,14 @@ public function testSessionMovePathUpdatedChild() // load nodes $parent = $this->session->getNode($src); - $child = $this->session->getNode($src . '/srcChild'); + $child = $this->session->getNode($src.'/srcChild'); $this->session->move($src, $dst); $this->assertEquals("$dst/srcChild", $child->getPath()); $this->assertEquals($dst, $parent->getPath()); $this->assertSame($parent, $this->session->getNode($dst)); - $this->assertSame($child, $this->session->getNode($dst . '/srcChild')); + $this->assertSame($child, $this->session->getNode($dst.'/srcChild')); } /** Verifies a moved node still has the child node */ @@ -320,9 +320,9 @@ public function testSessionMoveMoved() public function testSessionMoveReplace() { - $src = $this->node->getPath() . '/node'; - $dst = $this->node->getPath() . '/moved'; - $src2 = $this->node->getPath() . '/replacement'; + $src = $this->node->getPath().'/node'; + $dst = $this->node->getPath().'/moved'; + $src2 = $this->node->getPath().'/replacement'; $this->node->getNode('node'); $this->node->getNode('replacement'); @@ -423,7 +423,7 @@ public function testSessionMoveChildMoved() $dst2 = '/tests_write_manipulation_move/testSessionMoveChildMoved/srcFile'; $this->session->move($src, $dst); - $this->session->move($dst . '/srcFile', $dst2); + $this->session->move($dst.'/srcFile', $dst2); // Session $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [S]'); diff --git a/tests/Writing/NamespaceRegistryTest.php b/tests/Writing/NamespaceRegistryTest.php index f959e285..f15e1587 100644 --- a/tests/Writing/NamespaceRegistryTest.php +++ b/tests/Writing/NamespaceRegistryTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Writing/NodeTypeAssignementTest.php b/tests/Writing/NodeTypeAssignementTest.php index d4970205..48ff48d7 100644 --- a/tests/Writing/NodeTypeAssignementTest.php +++ b/tests/Writing/NodeTypeAssignementTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -59,7 +59,7 @@ public static function mixinTypes() */ public function testAddMixinOnNewNode($mixin) { - $newNode = $this->node->addNode('parent-' . strtr($mixin, ':', '-'), 'nt:unstructured'); + $newNode = $this->node->addNode('parent-'.strtr($mixin, ':', '-'), 'nt:unstructured'); $newNode->addMixin($mixin); $path = $newNode->getPath(); $session = $this->saveAndRenewSession(); diff --git a/tests/Writing/NodeTypePreemptiveValidationTest.php b/tests/Writing/NodeTypePreemptiveValidationTest.php index 30e55b0e..8d6fdfad 100644 --- a/tests/Writing/NodeTypePreemptiveValidationTest.php +++ b/tests/Writing/NodeTypePreemptiveValidationTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Writing/SetPropertyDynamicRebindingTest.php b/tests/Writing/SetPropertyDynamicRebindingTest.php index 2b3c43e7..d693c9c2 100644 --- a/tests/Writing/SetPropertyDynamicRebindingTest.php +++ b/tests/Writing/SetPropertyDynamicRebindingTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -78,7 +78,7 @@ public function testDynamicRebinding($propName, $sourcePropType, $sourcePropValu // Read it from backend check it's still valid $this->saveAndRenewSession(); - $prop = $this->session->getProperty('/' . $propName); + $prop = $this->session->getProperty('/'.$propName); $this->assertInstanceOf('\PHPCR\PropertyInterface', $prop); $this->assertEquals($sourcePropType, $prop->getType(), 'Initial property type does not match after saving'); @@ -121,7 +121,7 @@ public function testDynamicRebinding($propName, $sourcePropType, $sourcePropValu // Finally re-read it from backend and check it's still ok $this->saveAndRenewSession(); - $prop = $this->session->getProperty('/' . $propName); + $prop = $this->session->getProperty('/'.$propName); $this->assertInstanceOf('\PHPCR\PropertyInterface', $prop); $this->assertEquals($destPropType, $prop->getType(), 'Property type does not match after re-binding and save'); @@ -182,8 +182,8 @@ public function dynamicRebindingProvider() foreach ($typesAndValues as $destKey => $destVal) { if ($sourceKey !== $destKey) { $propName = - 'dynRebinding_' . PropertyType::nameFromValue($sourceKey) . - '_To_' . PropertyType::nameFromValue($destKey); + 'dynRebinding_'.PropertyType::nameFromValue($sourceKey). + '_To_'.PropertyType::nameFromValue($destKey); $provider[] = array($propName, $sourceKey, $sourceVal, $destKey, $destVal, $getters[$destKey]); } } diff --git a/tests/Writing/SetPropertyMethodsTest.php b/tests/Writing/SetPropertyMethodsTest.php index 680b2a00..19234b02 100644 --- a/tests/Writing/SetPropertyMethodsTest.php +++ b/tests/Writing/SetPropertyMethodsTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -280,18 +280,18 @@ public function testNewNodeSetProperty() { $node = $this->node->addNode('child'); $prop = $node->setProperty('p', 'abc'); - $this->assertTrue($this->session->nodeExists($this->nodePath . '/child')); - $this->assertTrue($this->session->propertyExists($this->nodePath . '/child/p')); + $this->assertTrue($this->session->nodeExists($this->nodePath.'/child')); + $this->assertTrue($this->session->propertyExists($this->nodePath.'/child/p')); $this->assertInstanceOf('\PHPCR\PropertyInterface', $prop); $this->assertEquals(\PHPCR\PropertyType::STRING, $prop->getType()); $this->assertEquals('abc', $prop->getString()); $session = $this->saveAndRenewSession(); - $this->assertTrue($session->nodeExists($this->nodePath . '/child')); - $this->assertTrue($session->propertyExists($this->nodePath . '/child/p')); + $this->assertTrue($session->nodeExists($this->nodePath.'/child')); + $this->assertTrue($session->propertyExists($this->nodePath.'/child/p')); - $node = $session->getNode($this->nodePath . '/child'); + $node = $session->getNode($this->nodePath.'/child'); $prop = $node->getProperty('p'); $this->assertInstanceOf('\PHPCR\PropertyInterface', $prop); @@ -311,12 +311,12 @@ public function testRemoveProperty() { $nodePath = '/tests_general_base/index.txt/jcr:content'; - $this->assertTrue($this->session->propertyExists($nodePath . '/jcr:data')); + $this->assertTrue($this->session->propertyExists($nodePath.'/jcr:data')); $node = $this->session->getNode($nodePath); $node->setProperty('jcr:data', null); $this->saveAndRenewSession(); - $this->assertFalse($this->session->propertyExists($nodePath . '/jcr:data')); + $this->assertFalse($this->session->propertyExists($nodePath.'/jcr:data')); } } diff --git a/tests/Writing/SetPropertyTypesTest.php b/tests/Writing/SetPropertyTypesTest.php index ba37f2bc..ca0a18d9 100644 --- a/tests/Writing/SetPropertyTypesTest.php +++ b/tests/Writing/SetPropertyTypesTest.php @@ -3,7 +3,7 @@ /* * This file is part of the PHPCR API Tests package * - * Copyright (c) 2013 Liip and others + * Copyright (c) 2015 Liip and others * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. From 28c31e23d0a6ec9fd6af9540ca061654824741a0 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Fri, 24 Jul 2015 17:21:01 +0200 Subject: [PATCH 7/7] add documentation about phpcs fixer --- .php_cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.php_cs b/.php_cs index ebd2145d..d12e8ecc 100644 --- a/.php_cs +++ b/.php_cs @@ -9,6 +9,9 @@ For the full copyright and license information, please view the LICENSE file that was distributed with this source code. EOF; +// Run the phpcsfixer from this directory to fix all code style issues +// https://github.com/FriendsOfPHP/PHP-CS-Fixer + Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header); return Symfony\CS\Config\Config::create() @@ -26,4 +29,4 @@ return Symfony\CS\Config\Config::create() ->exclude('vendor') ->in(__DIR__) ) -; +;