Skip to content

Commit 453857a

Browse files
committed
Cleaning up test for copy from other workspace
1 parent 70e7d2f commit 453857a

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed

fixtures/10_Writing/copy.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@
6464
</sv:property>
6565
</sv:node>
6666
</sv:node>
67+
<sv:node sv:name="testWorkspaceCopyOther">
68+
<sv:property sv:name="jcr:primaryType" sv:type="Name">
69+
<sv:value>nt:unstructured</sv:value>
70+
</sv:property>
71+
</sv:node>
6772
<sv:node sv:name="testCopyProperty">
6873
<sv:property sv:name="jcr:primaryType" sv:type="Name">
6974
<sv:value>nt:folder</sv:value>

fixtures/general/additionalWorkspace.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,17 @@
6161
</sv:property>
6262
</sv:node>
6363
</sv:node>
64-
<sv:node sv:name="testCopyFromAnotherWorkspace">
64+
<sv:node sv:name="testWorkspaceCopyOther">
6565
<sv:property sv:name="jcr:primaryType" sv:type="Name">
6666
<sv:value>nt:unstructured</sv:value>
6767
</sv:property>
6868
<sv:node sv:name="node">
6969
<sv:property sv:name="jcr:primaryType" sv:type="Name">
7070
<sv:value>nt:unstructured</sv:value>
7171
</sv:property>
72+
<sv:property sv:name="x" sv:type="String">
73+
<sv:value>y</sv:value>
74+
</sv:property>
7275
</sv:node>
7376
</sv:node>
7477
</sv:node>

tests/10_Writing/CopyMethodsTest.php

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,20 @@ public function testWorkspaceCopy()
7171
$this->assertNotEquals($sfile->getPropertyValue('jcr:data'), $dfile->getPropertyValue('jcr:data'));
7272
}
7373

74-
public function testCopyFromAnotherWorkspace()
74+
public function testWorkspaceCopyOther()
7575
{
76-
self::$staticSharedFixture['ie']->import('general/additionalWorkspace', 'additionalWorkspace');
77-
$src = '/tests_additional_workspace/testCopyNoSuchWorkspace/node';
78-
$dst = '/tests_write_manipulation_copy/testCopyFromAnotherWorkspace/foobar';
79-
80-
$this->ws->copy($src, $dst, 'testsAdditional');
81-
$node = $this->session->getNode($dest);
76+
self::$staticSharedFixture['ie']->import('general/additionalWorkspace', 'testsAdditional');
77+
$src = '/tests_additional_workspace/testWorkspaceCopyOther/node';
78+
$dst = '/tests_write_manipulation_copy/testWorkspaceCopyOther/foobar';
79+
80+
$this->ws->copy($src, $dst, self::$loader->getOtherWorkspaceName());
81+
$node = $this->session->getNode($dst);
82+
$this->assertTrue($node->hasProperty('x'));
83+
$this->assertEquals('y', $node->getPropertyValue('x'));
8284
}
8385

8486
/**
85-
* @expectedException \PHPCR\NoSuchWorkspaceException
87+
* @expectedException \PHPCR\NoSuchWorkspaceException
8688
*/
8789
public function testCopyNoSuchWorkspace()
8890
{
@@ -91,21 +93,16 @@ public function testCopyNoSuchWorkspace()
9193
$this->ws->copy($src, $dst, 'inexistentworkspace');
9294
}
9395

94-
public function testWorkspaceCopyBackend()
95-
{
96-
$this->markTestIncomplete('TODO: just do');
97-
}
98-
9996
/**
100-
* @expectedException \PHPCR\RepositoryException
97+
* @expectedException \PHPCR\RepositoryException
10198
*/
10299
public function testCopyRelativePaths()
103100
{
104101
$this->ws->copy('foo/moo', 'bar/mar');
105102
}
106103

107104
/**
108-
* @expectedException \PHPCR\RepositoryException
105+
* @expectedException \PHPCR\RepositoryException
109106
*/
110107
public function testCopyInvalidDstPath()
111108
{
@@ -115,7 +112,7 @@ public function testCopyInvalidDstPath()
115112
}
116113

117114
/**
118-
* @expectedException \PHPCR\RepositoryException
115+
* @expectedException \PHPCR\RepositoryException
119116
*/
120117
public function testCopyProperty()
121118
{
@@ -125,7 +122,7 @@ public function testCopyProperty()
125122
}
126123

127124
/**
128-
* @expectedException \PHPCR\PathNotFoundException
125+
* @expectedException \PHPCR\PathNotFoundException
129126
*/
130127
public function testCopySrcNotFound()
131128
{
@@ -135,7 +132,7 @@ public function testCopySrcNotFound()
135132
}
136133

137134
/**
138-
* @expectedException \PHPCR\PathNotFoundException
135+
* @expectedException \PHPCR\PathNotFoundException
139136
*/
140137
public function testCopyDstParentNotFound()
141138
{
@@ -147,7 +144,7 @@ public function testCopyDstParentNotFound()
147144
/**
148145
* Verifies that there is no update-on-copy if the target node already exists
149146
*
150-
* @expectedException \PHPCR\ItemExistsException
147+
* @expectedException \PHPCR\ItemExistsException
151148
*/
152149
public function testCopyNoUpdateOnCopy()
153150
{

0 commit comments

Comments
 (0)