From f2aad915d301cd56dc9f15749037699b686ea1eb Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Sun, 17 Sep 2023 15:44:16 +0100 Subject: [PATCH] test: test default pattern matches all files --- test/phpunit/DirectorySyncTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/phpunit/DirectorySyncTest.php b/test/phpunit/DirectorySyncTest.php index 0b5cb3a..f48eb3b 100644 --- a/test/phpunit/DirectorySyncTest.php +++ b/test/phpunit/DirectorySyncTest.php @@ -224,4 +224,16 @@ public function testSetPattern():void { $copiedFiles = $sut->getCopiedFilesList(); self::assertCount(0, $copiedFiles); } + + public function testDefaultPatternMatchesAllFiles():void { + $source = $this->getRandomTmp(); + $dest = $this->getRandomTmp(); + mkdir($source, recursive: true); + $this->createRandomFiles($source); + + $sut = new DirectorySync($source, $dest, $source); + $sut->exec(); + $copiedFiles = $sut->getCopiedFilesList(); + self::assertCount(3, $copiedFiles); + } }