Fixed AbstractProfilerStorageTest and some minor CS changes.

This commit is contained in:
H. Westphal 2012-02-28 20:43:34 +01:00
parent 1ac581e324
commit ed8c1c0572
5 changed files with 8 additions and 8 deletions

View File

@ -83,7 +83,7 @@ abstract class BaseMemcacheProfilerStorage implements ProfilerStorageInterface
if ($a['time'] === $b['time']) {
return 0;
}
return ($a['time'] > $b['time']) ? -1 : 1;
return $a['time'] > $b['time'] ? -1 : 1;
});
return $result;

View File

@ -60,22 +60,22 @@ abstract class AbstractProfilerStorageTest extends \PHPUnit_Framework_TestCase
// The storage accepts special characters in URLs (Even though URLs are not
// supposed to contain them)
$profile = new Profile('simple_quote');
$profile->setUrl('127.0.0.1', 'http://foo.bar/\'');
$profile->setUrl('http://foo.bar/\'');
$this->getStorage()->write($profile);
$this->assertTrue(false !== $this->getStorage()->read('simple_quote'), '->write() accepts single quotes in URL');
$profile = new Profile('double_quote');
$profile->setUrl('127.0.0.1', 'http://foo.bar/"');
$profile->setUrl('http://foo.bar/"');
$this->getStorage()->write($profile);
$this->assertTrue(false !== $this->getStorage()->read('double_quote'), '->write() accepts double quotes in URL');
$profile = new Profile('backslash');
$profile->setUrl('127.0.0.1', 'http://foo.bar/\\');
$profile->setUrl('http://foo.bar/\\');
$this->getStorage()->write($profile);
$this->assertTrue(false !== $this->getStorage()->read('backslash'), '->write() accepts backslash in URL');
$profile = new Profile('comma');
$profile->setUrl('127.0.0.1', 'http://foo.bar/,');
$profile->setUrl('http://foo.bar/,');
$this->getStorage()->write($profile);
$this->assertTrue(false !== $this->getStorage()->read('comma'), '->write() accepts comma in URL');
}

View File

@ -38,7 +38,7 @@ class FileProfilerStorageTest extends AbstractProfilerStorageTest
if (is_dir(self::$tmpDir)) {
self::cleanDir();
}
self::$storage = new FileProfilerStorage('file:' . self::$tmpDir);
self::$storage = new FileProfilerStorage('file:'.self::$tmpDir);
}
public static function tearDownAfterClass()

View File

@ -53,7 +53,7 @@ class MongoDbProfilerStorageTest extends AbstractProfilerStorageTest
$dt = new \DateTime('-2 day');
for ($i = 0; $i < 3; $i++) {
$dt->modify('-1 day');
$profile = new Profile('time_' . $i);
$profile = new Profile('time_'.$i);
$profile->setTime($dt->getTimestamp());
$profile->setMethod('GET');
self::$storage->write($profile);

View File

@ -25,7 +25,7 @@ class SqliteProfilerStorageTest extends AbstractProfilerStorageTest
if (file_exists(self::$dbFile)) {
@unlink(self::$dbFile);
}
self::$storage = new SqliteProfilerStorage('sqlite:' . self::$dbFile);
self::$storage = new SqliteProfilerStorage('sqlite:'.self::$dbFile);
}
public static function tearDownAfterClass()