Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit69d116e

Browse files
author
Julien Jacottet
committed
fix(upload): keep files and folders starting with a dot
1 parenta1051b8 commit69d116e

File tree

6 files changed

+42
-0
lines changed

6 files changed

+42
-0
lines changed

‎src/Automate/Archiver.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function archive(string $path, array $exclude = []): \PharData
4141
if (is_dir($path)) {
4242
$finder =newFinder();
4343
$finder->files()
44+
->ignoreDotFiles(false)
4445
->in($path)
4546
->notPath($exclude);
4647

‎tests/Automate/ArchiverTest.php‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Automate package.
5+
*
6+
* (c) Julien Jacottet <jjacottet@gmail.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespaceAutomate;
13+
14+
usePHPUnit\Framework\TestCase;
15+
16+
class ArchiverTestextends TestCase
17+
{
18+
privateconststringPATH =__DIR__.'/../fixtures/folder';
19+
20+
privateArchiver$archiver;
21+
22+
protectedfunctionsetUp():void
23+
{
24+
$this->archiver =newArchiver();
25+
}
26+
27+
protectedfunctiontearDown():void
28+
{
29+
$this->archiver->clear(self::PATH);
30+
}
31+
32+
publicfunctiontestArchive():void
33+
{
34+
$phar =$this->archiver->archive(self::PATH);
35+
36+
$this->assertTrue($phar->offsetExists('tests/fixtures/folder/a.txt'));
37+
$this->assertTrue($phar->offsetExists('tests/fixtures/folder/sub/b.txt'));
38+
$this->assertTrue($phar->offsetExists('tests/fixtures/folder/.sub/c.txt'));
39+
$this->assertTrue($phar->offsetExists('tests/fixtures/folder/.d.txt'));
40+
}
41+
}

‎tests/fixtures/folder/.d.txt‎

Whitespace-only changes.

‎tests/fixtures/folder/.sub/c.txt‎

Whitespace-only changes.

‎tests/fixtures/folder/a.txt‎

Whitespace-only changes.

‎tests/fixtures/folder/sub/b.txt‎

Whitespace-only changes.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp