mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
run php-cs-fixer
This commit is contained in:
parent
de8e83ce7e
commit
2842dffb51
41 changed files with 151 additions and 141 deletions
|
|
@ -44,47 +44,47 @@ abstract class AbstractShareTest extends TestCase {
|
|||
}
|
||||
|
||||
public function nameProvider() {
|
||||
return array(
|
||||
array('simple'),
|
||||
array('with spaces_and-underscores'),
|
||||
array("single'quote'"),
|
||||
array("foo ; asd -- bar"),
|
||||
array('日本語'),
|
||||
array('url %2F +encode'),
|
||||
array('a somewhat longer filename than the other with more charaters as the all the other filenames'),
|
||||
array('$as#d€££Ö€ßœĚęĘĞĜΣΥΦΩΫ')
|
||||
);
|
||||
return [
|
||||
['simple'],
|
||||
['with spaces_and-underscores'],
|
||||
["single'quote'"],
|
||||
["foo ; asd -- bar"],
|
||||
['日本語'],
|
||||
['url %2F +encode'],
|
||||
['a somewhat longer filename than the other with more charaters as the all the other filenames'],
|
||||
['$as#d€££Ö€ßœĚęĘĞĜΣΥΦΩΫ']
|
||||
];
|
||||
}
|
||||
|
||||
public function invalidPathProvider() {
|
||||
// / ? < > \ : * | " are illegal characters in path on windows
|
||||
return array(
|
||||
array("new\nline"),
|
||||
array("\rreturn"),
|
||||
array('null' . chr(0) . 'byte'),
|
||||
array('foo?bar'),
|
||||
array('foo<bar>'),
|
||||
array('foo:bar'),
|
||||
array('foo*bar'),
|
||||
array('foo|bar'),
|
||||
array('foo"bar"')
|
||||
);
|
||||
return [
|
||||
["new\nline"],
|
||||
["\rreturn"],
|
||||
['null' . chr(0) . 'byte'],
|
||||
['foo?bar'],
|
||||
['foo<bar>'],
|
||||
['foo:bar'],
|
||||
['foo*bar'],
|
||||
['foo|bar'],
|
||||
['foo"bar"']
|
||||
];
|
||||
}
|
||||
|
||||
public function fileDataProvider() {
|
||||
return array(
|
||||
array('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'),
|
||||
array('Mixed language, 日本語 が わからか and Various _/* characters \\|” €')
|
||||
);
|
||||
return [
|
||||
['Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'],
|
||||
['Mixed language, 日本語 が わからか and Various _/* characters \\|” €']
|
||||
];
|
||||
}
|
||||
|
||||
public function nameAndDataProvider() {
|
||||
$names = $this->nameProvider();
|
||||
$data = $this->fileDataProvider();
|
||||
$result = array();
|
||||
$result = [];
|
||||
foreach ($names as $name) {
|
||||
foreach ($data as $text) {
|
||||
$result[] = array($name[0], $text[0]);
|
||||
$result[] = [$name[0], $text[0]];
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
|
|
@ -122,7 +122,7 @@ abstract class AbstractShareTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testRootStartsEmpty() {
|
||||
$this->assertEquals(array(), $this->share->dir($this->root));
|
||||
$this->assertEquals([], $this->share->dir($this->root));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -610,16 +610,16 @@ abstract class AbstractShareTest extends TestCase {
|
|||
|
||||
public function pathProvider() {
|
||||
// / ? < > \ : * | " are illegal characters in path on windows
|
||||
return array(
|
||||
array('dir/sub/foo.txt'),
|
||||
array('bar.txt'),
|
||||
array("single'quote'/sub/foo.txt"),
|
||||
array('日本語/url %2F +encode/asd.txt'),
|
||||
array(
|
||||
return [
|
||||
['dir/sub/foo.txt'],
|
||||
['bar.txt'],
|
||||
["single'quote'/sub/foo.txt"],
|
||||
['日本語/url %2F +encode/asd.txt'],
|
||||
[
|
||||
'a somewhat longer folder than the other with more charaters as the all the other filenames/' .
|
||||
'followed by a somewhat long file name after that.txt'
|
||||
)
|
||||
);
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@ class NotifyHandlerTest extends TestCase {
|
|||
try {
|
||||
$share->mkdir('sub');
|
||||
} catch (AlreadyExistsException $e) {
|
||||
|
||||
}
|
||||
$process = $share->notify('sub');
|
||||
usleep(1000 * 100);// give it some time to start listening
|
||||
|
|
|
|||
|
|
@ -7,22 +7,21 @@
|
|||
|
||||
namespace Icewind\SMB\Test;
|
||||
|
||||
|
||||
use Icewind\SMB\IFileInfo;
|
||||
use Icewind\SMB\Wrapped\FileInfo;
|
||||
|
||||
class ParserTest extends \PHPUnit_Framework_TestCase {
|
||||
public function modeProvider() {
|
||||
return array(
|
||||
array('D', IFileInfo::MODE_DIRECTORY),
|
||||
array('A', IFileInfo::MODE_ARCHIVE),
|
||||
array('S', IFileInfo::MODE_SYSTEM),
|
||||
array('H', IFileInfo::MODE_HIDDEN),
|
||||
array('R', IFileInfo::MODE_READONLY),
|
||||
array('N', IFileInfo::MODE_NORMAL),
|
||||
array('RA', IFileInfo::MODE_READONLY | IFileInfo::MODE_ARCHIVE),
|
||||
array('RAH', IFileInfo::MODE_READONLY | IFileInfo::MODE_ARCHIVE | IFileInfo::MODE_HIDDEN)
|
||||
);
|
||||
return [
|
||||
['D', IFileInfo::MODE_DIRECTORY],
|
||||
['A', IFileInfo::MODE_ARCHIVE],
|
||||
['S', IFileInfo::MODE_SYSTEM],
|
||||
['H', IFileInfo::MODE_HIDDEN],
|
||||
['R', IFileInfo::MODE_READONLY],
|
||||
['N', IFileInfo::MODE_NORMAL],
|
||||
['RA', IFileInfo::MODE_READONLY | IFileInfo::MODE_ARCHIVE],
|
||||
['RAH', IFileInfo::MODE_READONLY | IFileInfo::MODE_ARCHIVE | IFileInfo::MODE_HIDDEN]
|
||||
];
|
||||
}
|
||||
/**
|
||||
* @dataProvider modeProvider
|
||||
|
|
@ -33,9 +32,9 @@ class ParserTest extends \PHPUnit_Framework_TestCase {
|
|||
}
|
||||
|
||||
public function statProvider() {
|
||||
return array(
|
||||
array(
|
||||
array(
|
||||
return [
|
||||
[
|
||||
[
|
||||
'altname: test.txt',
|
||||
'create_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'access_time: Tue Oct 15 02:58:48 PM 2013 CEST',
|
||||
|
|
@ -43,15 +42,15 @@ class ParserTest extends \PHPUnit_Framework_TestCase {
|
|||
'change_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'attributes: (80)',
|
||||
'stream: [::$DATA], 29634 bytes'
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'mtime' => strtotime('12 Oct 2013 19:05:58 CEST'),
|
||||
'mode' => IFileInfo::MODE_NORMAL,
|
||||
'size' => 29634
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'mode' => IFileInfo::MODE_NORMAL,
|
||||
'size' => 29634
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
'altname: folder',
|
||||
'create_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'access_time: Tue Oct 15 02:58:48 PM 2013 CEST',
|
||||
|
|
@ -59,15 +58,15 @@ class ParserTest extends \PHPUnit_Framework_TestCase {
|
|||
'change_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'attributes: D (10)',
|
||||
'stream: [::$DATA], 29634 bytes'
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'mtime' => strtotime('12 Oct 2013 19:05:58 CEST'),
|
||||
'mode' => IFileInfo::MODE_DIRECTORY,
|
||||
'size' => 29634
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'mode' => IFileInfo::MODE_DIRECTORY,
|
||||
'size' => 29634
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
'altname: .hidden',
|
||||
'create_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'access_time: Tue Oct 15 02:58:48 PM 2013 CEST',
|
||||
|
|
@ -75,14 +74,14 @@ class ParserTest extends \PHPUnit_Framework_TestCase {
|
|||
'change_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'attributes: HA (22)',
|
||||
'stream: [::$DATA], 29634 bytes'
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'mtime' => strtotime('12 Oct 2013 19:05:58 CEST'),
|
||||
'mode' => IFileInfo::MODE_HIDDEN + IFileInfo::MODE_ARCHIVE,
|
||||
'size' => 29634
|
||||
)
|
||||
)
|
||||
);
|
||||
'mode' => IFileInfo::MODE_HIDDEN + IFileInfo::MODE_ARCHIVE,
|
||||
'size' => 29634
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -94,21 +93,26 @@ class ParserTest extends \PHPUnit_Framework_TestCase {
|
|||
}
|
||||
|
||||
public function dirProvider() {
|
||||
return array(
|
||||
array(
|
||||
array(
|
||||
return [
|
||||
[
|
||||
[
|
||||
' . D 0 Tue Aug 26 19:11:56 2014',
|
||||
' .. DR 0 Sun Oct 28 15:24:02 2012',
|
||||
' c.pdf N 29634 Sat Oct 12 19:05:58 2013',
|
||||
'',
|
||||
' 62536 blocks of size 8388608. 57113 blocks available'
|
||||
),
|
||||
array(
|
||||
new FileInfo('/c.pdf', 'c.pdf', 29634, strtotime('12 Oct 2013 19:05:58 CEST'),
|
||||
IFileInfo::MODE_NORMAL)
|
||||
)
|
||||
)
|
||||
);
|
||||
],
|
||||
[
|
||||
new FileInfo(
|
||||
'/c.pdf',
|
||||
'c.pdf',
|
||||
29634,
|
||||
strtotime('12 Oct 2013 19:05:58 CEST'),
|
||||
IFileInfo::MODE_NORMAL
|
||||
)
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
namespace Icewind\SMB\Test;
|
||||
|
||||
|
||||
use Icewind\SMB\AnonymousAuth;
|
||||
use Icewind\SMB\IAuth;
|
||||
use Icewind\SMB\Native\NativeServer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue