[HttpKernel] fixed some unit tests
This commit is contained in:
parent
47fca8e0a0
commit
18c6a86291
@ -146,10 +146,13 @@ class FileProfilerStorage implements ProfilerStorageInterface
|
||||
'url' => $profile->getUrl(),
|
||||
'time' => $profile->getTime(),
|
||||
);
|
||||
file_put_contents($file, serialize($data));
|
||||
|
||||
if (false === file_put_contents($file, serialize($data))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Add to index
|
||||
if (false === $file = fopen($this->getIndexFilename(), 'w')) {
|
||||
if (false === $file = fopen($this->getIndexFilename(), 'a')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ class FileProfilerStorageTest extends \PHPUnit_Framework_TestCase
|
||||
$profile = new Profile('token');
|
||||
|
||||
$this->assertTrue(true === self::$storage->write($profile), '->write() returns true when the token is unique');
|
||||
$this->assertTrue(false === self::$storage->write($profile), '->write() return false when the token is already present in the DB');
|
||||
$this->assertTrue(true === self::$storage->write($profile), '->write() overwrites when the token is already present in the DB');
|
||||
}
|
||||
|
||||
public function testRetrieveByIp()
|
||||
|
Reference in New Issue
Block a user