From 2df721ee359af3c57757a639c52f49f02decff6e Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Mon, 18 Mar 2019 10:04:59 +0100 Subject: [PATCH 1/3] Added test for a directory creation case. --- tests/ftp/FtpIntegrationTestCase.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/ftp/FtpIntegrationTestCase.php b/tests/ftp/FtpIntegrationTestCase.php index 6149f49ba..b89ce5369 100644 --- a/tests/ftp/FtpIntegrationTestCase.php +++ b/tests/ftp/FtpIntegrationTestCase.php @@ -63,6 +63,19 @@ public function writing_reading_deleting() $this->assertTrue($filesystem->delete('path.txt')); } + + + /** + * @test + * @depends testInstantiable + */ + public function creating_a_directory() + { + $this->filesystem->createDir('.dirname/directory'); + $metadata = $this->filesystem->getMetadata('.dirname/directory'); + self::assertEquals('dir', $metadata['type']); + } + /** * @test * @depends testInstantiable @@ -97,4 +110,4 @@ public function listing_files_of_a_directory() $filesystem->deleteDir('dirname'); $this->assertEquals($expected, $files); } -} \ No newline at end of file +} From b258bfde8c9403a7cffb9bdaf4c1f11961765793 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Mon, 18 Mar 2019 14:12:18 +0100 Subject: [PATCH 2/3] Check creating a normal directory. --- tests/ftp/FtpIntegrationTestCase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ftp/FtpIntegrationTestCase.php b/tests/ftp/FtpIntegrationTestCase.php index b89ce5369..a67ad1e97 100644 --- a/tests/ftp/FtpIntegrationTestCase.php +++ b/tests/ftp/FtpIntegrationTestCase.php @@ -71,8 +71,8 @@ public function writing_reading_deleting() */ public function creating_a_directory() { - $this->filesystem->createDir('.dirname/directory'); - $metadata = $this->filesystem->getMetadata('.dirname/directory'); + $this->filesystem->createDir('dirname/directory'); + $metadata = $this->filesystem->getMetadata('dirname/directory'); self::assertEquals('dir', $metadata['type']); } From ca7c055469d65b5827374d5a30098e5d017c32ab Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Mon, 18 Mar 2019 14:19:47 +0100 Subject: [PATCH 3/3] Cleanup directory --- tests/ftp/FtpIntegrationTestCase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ftp/FtpIntegrationTestCase.php b/tests/ftp/FtpIntegrationTestCase.php index a67ad1e97..53a342c9f 100644 --- a/tests/ftp/FtpIntegrationTestCase.php +++ b/tests/ftp/FtpIntegrationTestCase.php @@ -74,6 +74,7 @@ public function creating_a_directory() $this->filesystem->createDir('dirname/directory'); $metadata = $this->filesystem->getMetadata('dirname/directory'); self::assertEquals('dir', $metadata['type']); + $this->filesystem->deleteDir('dirname'); } /**