@@ 44-55 (lines=12) @@ | ||
41 | static::assertInstanceOf(FileTransferInterface::class, $this->transfer); |
|
42 | } |
|
43 | ||
44 | public function testCopyBetweenFileSystems() |
|
45 | { |
|
46 | $fromFile = new LocalFile(static::$dir . 'from_between.text'); |
|
47 | $fromFile->put('Some Text In Here'); |
|
48 | ||
49 | $toFile = new FileNode(new Filesystem(new MemoryAdapter()), 'some_file'); |
|
50 | ||
51 | $this->transfer->copyTo($fromFile, $toFile); |
|
52 | ||
53 | static::assertEquals('Some Text In Here', $toFile->read()); |
|
54 | static::assertEquals($fromFile->read(), $toFile->read()); |
|
55 | } |
|
56 | ||
57 | public function testCopyBetweenSameFileSystem() |
|
58 | { |
|
@@ 57-68 (lines=12) @@ | ||
54 | static::assertEquals($fromFile->read(), $toFile->read()); |
|
55 | } |
|
56 | ||
57 | public function testCopyBetweenSameFileSystem() |
|
58 | { |
|
59 | $fromFile = new LocalFile(static::$dir . 'from_same.text'); |
|
60 | $fromFile->put('Some Text In Here'); |
|
61 | ||
62 | $toFile = new LocalFile(static::$dir . 'to_same.text'); |
|
63 | ||
64 | $this->transfer->copyTo($fromFile, $toFile); |
|
65 | ||
66 | static::assertEquals('Some Text In Here', $toFile->read()); |
|
67 | static::assertEquals($fromFile->read(), $toFile->read()); |
|
68 | } |
|
69 | ||
70 | public function testMoveDeletesTheOldFile() |
|
71 | { |
|
@@ 70-81 (lines=12) @@ | ||
67 | static::assertEquals($fromFile->read(), $toFile->read()); |
|
68 | } |
|
69 | ||
70 | public function testMoveDeletesTheOldFile() |
|
71 | { |
|
72 | $fromFile = new LocalFile(static::$dir . 'delete_from.text'); |
|
73 | $fromFile->put('Some Text In Here'); |
|
74 | ||
75 | $toFile = new LocalFile(static::$dir . 'delete_to.text'); |
|
76 | ||
77 | $this->transfer->moveTo($fromFile, $toFile); |
|
78 | ||
79 | static::assertEquals('Some Text In Here', $toFile->read()); |
|
80 | static::assertFalse($fromFile->exists()); |
|
81 | } |
|
82 | ||
83 | public function testCopyWhenOriginalFileDoesNotExistThrowsAnException() |
|
84 | { |