File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 484484 </sv : node >
485485 </sv : node >
486486 </sv : node >
487+
488+ <sv : node sv : name =" testCopyChildrenBinaryData" >
489+ <sv : property sv : name =" jcr:primaryType" sv : type =" Name" >
490+ <sv : value >nt:unstructured</sv : value >
491+ </sv : property >
492+ <sv : node sv : name =" srcNode" >
493+ <sv : property sv : name =" jcr:primaryType" sv : type =" Name" >
494+ <sv : value >nt:unstructured</sv : value >
495+ </sv : property >
496+ <sv : node sv : name =" data.bin" >
497+ <sv : property sv : name =" jcr:primaryType" sv : type =" Name" >
498+ <sv : value >nt:unstructured</sv : value >
499+ </sv : property >
500+ <sv : property sv : name =" jcr:data" sv : type =" Binary" ><sv : value >RnVzY2UgZmVybWVudHVtLiBBbGlxdWFtIGxvYm9ydGlzLiBNYXVyaXMgdHVycGlzIG51bmMsIGJsYW5kaXQgZXQsIHZvbHV0cGF0IG1vbGVzdGllLCBwb3J0YSB1dCwgbGlndWxhLiBQZWxsZW50ZXNxdWUgYXVjdG9yIG5lcXVlIG5lYyB1cm5hLiBQcm9pbiBtYWduYS4gQ3VyYWJpdHVyIHVsbGFtY29ycGVyIHVsdHJpY2llcyBuaXNpLiBQcmFlc2VudCBjb25ndWUgZXJhdCBhdCBtYXNzYS4gTmFtIGFkaXBpc2NpbmcuIE51bGxhIHBvcnRhIGRvbG9yLiBGdXNjZSBjb21tb2RvIGFsaXF1YW0gYXJjdS4=</sv : value >
501+ </sv : property >
502+ </sv : node >
503+ </sv : node >
504+ </sv : node >
487505</sv : node >
Original file line number Diff line number Diff line change @@ -239,4 +239,32 @@ public function testCopyUpdateReferencesMultiValue()
239239
240240 $ this ->assertCount (2 , $ references );
241241 }
242+
243+ /**
244+ * Verifies that transport::copy actually copies binary data of children nodes
245+ */
246+ public function testCopyChildrenBinaryData ()
247+ {
248+ $ src = '/tests_write_manipulation_copy/testCopyChildrenBinaryData/srcNode ' ;
249+ $ dst = '/tests_write_manipulation_copy/testCopyChildrenBinaryData/dstNode ' ;
250+
251+ $ this ->ws ->copy ($ src , $ dst );
252+ $ this ->session ->refresh (true );
253+ $ srcChild = $ this ->session ->getNode ($ src .'/data.bin ' );
254+ $ dstChild = $ this ->session ->getNode ($ dst .'/data.bin ' );
255+
256+ $ srcProp = $ srcChild ->getProperty ('jcr:data ' );
257+ $ dstProp = $ dstChild ->getProperty ('jcr:data ' );
258+
259+ $ this ->assertEquals (\PHPCR \PropertyType::BINARY , $ srcProp ->getType ());
260+ $ this ->assertEquals (\PHPCR \PropertyType::BINARY , $ dstProp ->getType ());
261+
262+ $ srcBin = $ srcProp ->getBinary ();
263+ $ dstBin = $ dstProp ->getBinary ();
264+
265+ $ this ->assertTrue (is_resource ($ srcBin ), 'Failed to get src binary stream ' );
266+ $ this ->assertTrue (is_resource ($ dstBin ), 'Failed to get dst binary stream ' );
267+
268+ $ this ->assertEquals (stream_get_contents ($ srcBin ), stream_get_contents ($ dstBin ));
269+ }
242270}
You can’t perform that action at this time.
0 commit comments