1<?php 2 3namespace Sabre\DAV; 4 5use Sabre\HTTP; 6 7class CopyTest extends \PHPUnit_Framework_TestCase { 8 9 public function setUp() { 10 11 \Sabre\TestUtil::clearTempDir(); 12 13 } 14 15 /** 16 * This test makes sure that a path like /foo cannot be copied into a path 17 * like /foo/bar/ 18 * 19 * @expectedException \Sabre\DAV\Exception\Conflict 20 */ 21 public function testCopyIntoSubPath() { 22 23 $dir = new FS\Directory(SABRE_TEMPDIR); 24 $server = new Server($dir); 25 26 $dir->createDirectory('foo'); 27 28 $request = new HTTP\Request('COPY','/foo', [ 29 'Destination' => '/foo/bar', 30 ]); 31 $response = new HTTP\ResponseMock(); 32 33 $server->invokeMethod($request, $response); 34 35 } 36 37} 38