Skip to content

Commit 142440d

Browse files
Merge branch '2.7' into 2.8
* 2.7: Various fixes esp. on Windows Fix the validation of form resources to register the default theme Fix the retrieval of the value with property path when using a loader [appveyor] minor enhancements [Process] Disable failing tests on Windows [Translation] Fix the string casting in the XliffFileLoader Windows and Intl fixes Add appveyor.yml for C.I. on Windows [VarDumper] fixed HtmlDumper to target specific the head tag [travis] merge php: nightly and deps=high test-matrix lines consistently use str_replace to unify directory separators Support omitting the <target> node in an .xlf file. Fix the handling of values for multiple choice types moved PHP nightly to PHP 7.0 [Security] Add missing docblock in PreAuthenticatedToken Conflicts: .travis.yml
2 parents 3baab64 + fff4b0c commit 142440d

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

Iterator/ExcludeDirectoryFilterIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(\Iterator $iterator, array $directories)
4343
public function accept()
4444
{
4545
$path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath();
46-
$path = strtr($path, '\\', '/');
46+
$path = str_replace('\\', '/', $path);
4747
foreach ($this->patterns as $pattern) {
4848
if (preg_match($pattern, $path)) {
4949
return false;

Iterator/PathFilterIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function accept()
2929
$filename = $this->current()->getRelativePathname();
3030

3131
if ('\\' === DIRECTORY_SEPARATOR) {
32-
$filename = strtr($filename, '\\', '/');
32+
$filename = str_replace('\\', '/', $filename);
3333
}
3434

3535
// should at least not match one rule to exclude

Tests/Iterator/RecursiveDirectoryIteratorTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ public function testSeek($path, $seekable, $contains, $message = null)
6060
$i->seek(1);
6161
$actual[] = $i->getPathname();
6262

63-
$i->seek(2);
64-
$actual[] = $i->getPathname();
65-
6663
$this->assertEquals($contains, $actual);
6764
}
6865

@@ -73,7 +70,6 @@ public function getPaths()
7370
// ftp
7471
$contains = array(
7572
'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'README',
76-
'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'index.html',
7773
'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'pub',
7874
);
7975
$data[] = array('ftp://ftp.mozilla.org/', false, $contains);

Tests/Iterator/SortableIteratorTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ public function testAccept($mode, $expected)
3333
if (!is_callable($mode)) {
3434
switch ($mode) {
3535
case SortableIterator::SORT_BY_ACCESSED_TIME :
36-
file_get_contents(self::toAbsolute('.git'));
36+
if ('\\' === DIRECTORY_SEPARATOR) {
37+
touch(self::toAbsolute('.git'));
38+
} else {
39+
file_get_contents(self::toAbsolute('.git'));
40+
}
3741
sleep(1);
3842
file_get_contents(self::toAbsolute('.bar'));
3943
break;
@@ -56,7 +60,11 @@ public function testAccept($mode, $expected)
5660

5761
if ($mode === SortableIterator::SORT_BY_ACCESSED_TIME
5862
|| $mode === SortableIterator::SORT_BY_CHANGED_TIME
59-
|| $mode === SortableIterator::SORT_BY_MODIFIED_TIME) {
63+
|| $mode === SortableIterator::SORT_BY_MODIFIED_TIME
64+
) {
65+
if ('\\' === DIRECTORY_SEPARATOR && SortableIterator::SORT_BY_MODIFIED_TIME !== $mode) {
66+
$this->markTestSkipped('Sorting by atime or ctime is not supported on Windows');
67+
}
6068
$this->assertOrderedIteratorForGroups($expected, $iterator);
6169
} else {
6270
$this->assertOrderedIterator($expected, $iterator);

Tests/Shell/CommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function testArg()
8686
$cmd = Command::create()->add('--force');
8787

8888
$cmd->arg('--run');
89-
$this->assertSame('--force \'--run\'', $cmd->join());
89+
$this->assertSame('--force '.escapeshellarg('--run'), $cmd->join());
9090
}
9191

9292
public function testCmd()

0 commit comments

Comments
 (0)