Skip to content

Commit e5e9eb8

Browse files
committed
Fix tests
1 parent 87df1f1 commit e5e9eb8

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@
101101
"symfony/security-acl": "~2.8|~3.0",
102102
"phpdocumentor/reflection-docblock": "^3.0|^4.0"
103103
},
104-
"provide": {
105-
"psr/log-implementation": "1.0.0"
106-
},
107104
"conflict": {
108105
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
109106
"phpdocumentor/type-resolver": "<0.2.0",
@@ -112,6 +109,7 @@
112109
"provide": {
113110
"psr/cache-implementation": "1.0",
114111
"psr/container-implementation": "1.0",
112+
"psr/log-implementation": "1.0",
115113
"psr/simple-cache-implementation": "1.0"
116114
},
117115
"autoload": {

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolClearerPass;
1919
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPrunerPass;
2020
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\DataCollectorTranslatorPass;
21-
use Symfony\Component\HttpKernel\DependencyInjection\LoggerPass;
2221
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TemplatingPass;
2322
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ProfilerPass;
2423
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\LoggingTranslatorPass;
@@ -32,6 +31,7 @@
3231
use Symfony\Component\HttpKernel\DependencyInjection\AddCacheClearerPass;
3332
use Symfony\Component\HttpKernel\DependencyInjection\AddCacheWarmerPass;
3433
use Symfony\Component\HttpKernel\DependencyInjection\ControllerArgumentValueResolverPass;
34+
use Symfony\Component\HttpKernel\DependencyInjection\LoggerPass;
3535
use Symfony\Component\HttpKernel\DependencyInjection\RegisterControllerArgumentLocatorsPass;
3636
use Symfony\Component\HttpKernel\DependencyInjection\RemoveEmptyControllerArgumentLocatorsPass;
3737
use Symfony\Component\HttpKernel\DependencyInjection\ResettableServicePass;

src/Symfony/Component/HttpKernel/Tests/Log/LoggerTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ class LoggerTest extends TestCase
3434

3535
protected function setUp()
3636
{
37-
$this->tmpFile = sys_get_temp_dir().'/log';
37+
$this->tmpFile = sys_get_temp_dir().DIRECTORY_SEPARATOR.'log';
3838
$this->logger = new Logger(LogLevel::DEBUG, $this->tmpFile);
3939
}
4040

4141
protected function tearDown()
4242
{
43-
unlink($this->tmpFile);
43+
if (!@unlink($this->tmpFile)) {
44+
file_put_contents($this->tmpFile, '');
45+
}
4446
}
4547

46-
private function assertLogsMatch(array $expected, array $given)
48+
public static function assertLogsMatch(array $expected, array $given)
4749
{
4850
foreach ($given as $k => $line) {
49-
if (!preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\+[0-9]{2}:[0-9]{2} '.preg_quote($expected[$k]).'/', $line)) {
50-
throw new \Exception("$line do not match expected pattern $expected[$k]");
51-
}
51+
self::assertThat(1 === preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[\+-][0-9]{2}:[0-9]{2} '.preg_quote($expected[$k]).'/', $line), self::isTrue(), "\"$line\" do not match expected pattern \"$expected[$k]\"");
5252
}
5353
}
5454

@@ -104,7 +104,7 @@ public function testLogLevelDisabled()
104104
$this->logger->log(LogLevel::DEBUG, 'test', array('user' => 'Bob'));
105105

106106
// Will always be true, but asserts than an exception isn't thrown
107-
$this->assertLogsMatch(array(), $this->getLogs());
107+
$this->assertSame(array(), $this->getLogs());
108108
}
109109

110110
/**

src/Symfony/Component/HttpKernel/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"psr/cache": "~1.0"
4242
},
4343
"provide": {
44-
"psr/log-implementation": "1.0.0"
44+
"psr/log-implementation": "1.0"
4545
},
4646
"conflict": {
4747
"symfony/config": "<2.8",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy