Skip to content

Commit 8c28686

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: fixed wrong merge Tweak message to be Flex friendly [Routing] fixed tests Fixing wrong class_exists on interface Preserve percent-encoding in URLs when performing redirects in the UrlMatcher [Console] Fix a bug when passing a letter that could be an alias add missing validation options to XSD file Take advantage of AnnotationRegistry::registerUniqueLoader [DI] Optimize Container::get() for perf fix merge Fix tests Refactoring tests.
2 parents c9d4a26 + 25b135b commit 8c28686

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

Tests/FilesystemTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testCopyCreatesNewFile()
2626
$this->filesystem->copy($sourceFilePath, $targetFilePath);
2727

2828
$this->assertFileExists($targetFilePath);
29-
$this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath));
29+
$this->assertStringEqualsFile($targetFilePath, 'SOURCE FILE');
3030
}
3131

3232
/**
@@ -73,7 +73,7 @@ public function testCopyOverridesExistingFileIfModified()
7373
$this->filesystem->copy($sourceFilePath, $targetFilePath);
7474

7575
$this->assertFileExists($targetFilePath);
76-
$this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath));
76+
$this->assertStringEqualsFile($targetFilePath, 'SOURCE FILE');
7777
}
7878

7979
public function testCopyDoesNotOverrideExistingFileByDefault()
@@ -92,7 +92,7 @@ public function testCopyDoesNotOverrideExistingFileByDefault()
9292
$this->filesystem->copy($sourceFilePath, $targetFilePath);
9393

9494
$this->assertFileExists($targetFilePath);
95-
$this->assertEquals('TARGET FILE', file_get_contents($targetFilePath));
95+
$this->assertStringEqualsFile($targetFilePath, 'TARGET FILE');
9696
}
9797

9898
public function testCopyOverridesExistingFileIfForced()
@@ -111,7 +111,7 @@ public function testCopyOverridesExistingFileIfForced()
111111
$this->filesystem->copy($sourceFilePath, $targetFilePath, true);
112112

113113
$this->assertFileExists($targetFilePath);
114-
$this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath));
114+
$this->assertStringEqualsFile($targetFilePath, 'SOURCE FILE');
115115
}
116116

117117
/**
@@ -153,7 +153,7 @@ public function testCopyCreatesTargetDirectoryIfItDoesNotExist()
153153

154154
$this->assertTrue(is_dir($targetFileDirectory));
155155
$this->assertFileExists($targetFilePath);
156-
$this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath));
156+
$this->assertStringEqualsFile($targetFilePath, 'SOURCE FILE');
157157
}
158158

159159
/**
@@ -836,9 +836,9 @@ public function testRemoveSymlink()
836836

837837
$this->filesystem->remove($link);
838838

839-
$this->assertTrue(!is_link($link));
840-
$this->assertTrue(!is_file($link));
841-
$this->assertTrue(!is_dir($link));
839+
$this->assertFalse(is_link($link));
840+
$this->assertFalse(is_file($link));
841+
$this->assertFalse(is_dir($link));
842842
}
843843

844844
public function testSymlinkIsOverwrittenIfPointsToDifferentTarget()
@@ -1458,7 +1458,7 @@ public function testDumpFile()
14581458

14591459
$this->filesystem->dumpFile($filename, 'bar');
14601460
$this->assertFileExists($filename);
1461-
$this->assertSame('bar', file_get_contents($filename));
1461+
$this->assertStringEqualsFile($filename, 'bar');
14621462

14631463
// skip mode check on Windows
14641464
if ('\\' !== DIRECTORY_SEPARATOR) {
@@ -1475,7 +1475,7 @@ public function testDumpFileOverwritesAnExistingFile()
14751475
$this->filesystem->dumpFile($filename, 'bar');
14761476

14771477
$this->assertFileExists($filename);
1478-
$this->assertSame('bar', file_get_contents($filename));
1478+
$this->assertStringEqualsFile($filename, 'bar');
14791479
}
14801480

14811481
public function testDumpFileWithFileScheme()
@@ -1486,7 +1486,7 @@ public function testDumpFileWithFileScheme()
14861486
$this->filesystem->dumpFile($filename, 'bar');
14871487

14881488
$this->assertFileExists($filename);
1489-
$this->assertSame('bar', file_get_contents($filename));
1489+
$this->assertStringEqualsFile($filename, 'bar');
14901490
}
14911491

14921492
public function testDumpFileWithZlibScheme()
@@ -1498,7 +1498,7 @@ public function testDumpFileWithZlibScheme()
14981498

14991499
// Zlib stat uses file:// wrapper so remove scheme
15001500
$this->assertFileExists(str_replace($scheme, '', $filename));
1501-
$this->assertSame('bar', file_get_contents($filename));
1501+
$this->assertStringEqualsFile($filename, 'bar');
15021502
}
15031503

15041504
public function testAppendToFile()
@@ -1515,7 +1515,7 @@ public function testAppendToFile()
15151515
$this->filesystem->appendToFile($filename, 'bar');
15161516

15171517
$this->assertFileExists($filename);
1518-
$this->assertSame('foobar', file_get_contents($filename));
1518+
$this->assertStringEqualsFile($filename, 'foobar');
15191519

15201520
// skip mode check on Windows
15211521
if ('\\' !== DIRECTORY_SEPARATOR) {
@@ -1533,7 +1533,7 @@ public function testAppendToFileWithScheme()
15331533
$this->filesystem->appendToFile($filename, 'bar');
15341534

15351535
$this->assertFileExists($filename);
1536-
$this->assertSame('foobar', file_get_contents($filename));
1536+
$this->assertStringEqualsFile($filename, 'foobar');
15371537
}
15381538

15391539
public function testAppendToFileWithZlibScheme()
@@ -1543,12 +1543,12 @@ public function testAppendToFileWithZlibScheme()
15431543
$this->filesystem->dumpFile($filename, 'foo');
15441544

15451545
// Zlib stat uses file:// wrapper so remove it
1546-
$this->assertSame('foo', file_get_contents(str_replace($scheme, '', $filename)));
1546+
$this->assertStringEqualsFile(str_replace($scheme, '', $filename), 'foo');
15471547

15481548
$this->filesystem->appendToFile($filename, 'bar');
15491549

15501550
$this->assertFileExists($filename);
1551-
$this->assertSame('foobar', file_get_contents($filename));
1551+
$this->assertStringEqualsFile($filename, 'foobar');
15521552
}
15531553

15541554
public function testAppendToFileCreateTheFileIfNotExists()
@@ -1569,7 +1569,7 @@ public function testAppendToFileCreateTheFileIfNotExists()
15691569
}
15701570

15711571
$this->assertFileExists($filename);
1572-
$this->assertSame('bar', file_get_contents($filename));
1572+
$this->assertStringEqualsFile($filename, 'bar');
15731573
}
15741574

15751575
public function testDumpKeepsExistingPermissionsWhenOverwritingAnExistingFile()

0 commit comments

Comments
 (0)