minor #28811 Remove usage of sf2 when possible (fabpot)

This PR was merged into the 4.2-dev branch.

Discussion
----------

Remove usage of sf2 when possible

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

I've not removed all `sf2` occurrences as I've kept the ones that would introduce a BC break.

Commits
-------

8406ee86a9 removed usage of sf2 when possible
This commit is contained in:
Fabien Potencier 2018-10-11 03:53:47 -07:00
commit 7cb823a5b6
17 changed files with 24 additions and 24 deletions

View File

@ -33,7 +33,7 @@ class CacheClearCommandTest extends TestCase
{
$this->fs = new Filesystem();
$this->kernel = new TestAppKernel('test', true);
$this->rootDir = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid('sf2_cache_', true);
$this->rootDir = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid('sf_cache_', true);
$this->kernel->setRootDir($this->rootDir);
$this->fs->mkdir($this->rootDir);
}

View File

@ -68,7 +68,7 @@ class TranslationDebugCommandTest extends TestCase
{
$this->fs->remove($this->translationDir);
$this->fs = new Filesystem();
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf2_translation', true);
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf_translation', true);
$this->fs->mkdir($this->translationDir.'/translations');
$this->fs->mkdir($this->translationDir.'/templates');
@ -112,7 +112,7 @@ class TranslationDebugCommandTest extends TestCase
protected function setUp()
{
$this->fs = new Filesystem();
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf2_translation', true);
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf_translation', true);
$this->fs->mkdir($this->translationDir.'/Resources/translations');
$this->fs->mkdir($this->translationDir.'/Resources/views');
$this->fs->mkdir($this->translationDir.'/translations');

View File

@ -34,7 +34,7 @@ class TranslationUpdateCommandTest extends TestCase
public function testDumpMessagesAndCleanInRootDirectory()
{
$this->fs->remove($this->translationDir);
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf2_translation', true);
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf_translation', true);
$this->fs->mkdir($this->translationDir.'/translations');
$this->fs->mkdir($this->translationDir.'/templates');
@ -71,7 +71,7 @@ class TranslationUpdateCommandTest extends TestCase
public function testWriteMessagesInRootDirectory()
{
$this->fs->remove($this->translationDir);
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf2_translation', true);
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf_translation', true);
$this->fs->mkdir($this->translationDir.'/translations');
$this->fs->mkdir($this->translationDir.'/templates');
@ -90,7 +90,7 @@ class TranslationUpdateCommandTest extends TestCase
protected function setUp()
{
$this->fs = new Filesystem();
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf2_translation', true);
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf_translation', true);
$this->fs->mkdir($this->translationDir.'/Resources/translations');
$this->fs->mkdir($this->translationDir.'/Resources/views');
$this->fs->mkdir($this->translationDir.'/translations');

View File

@ -24,7 +24,7 @@ class TranslatorTest extends TestCase
protected function setUp()
{
$this->tmpDir = sys_get_temp_dir().'/sf2_translation';
$this->tmpDir = sys_get_temp_dir().'/sf_translation';
$this->deleteTmpDir();
}

View File

@ -595,7 +595,7 @@ class CompoundFormTest extends AbstractFormTest
*/
public function testSubmitPostOrPutRequest($method)
{
$path = tempnam(sys_get_temp_dir(), 'sf2');
$path = tempnam(sys_get_temp_dir(), 'sf');
touch($path);
file_put_contents($path, 'zaza');
$values = array(
@ -643,7 +643,7 @@ class CompoundFormTest extends AbstractFormTest
*/
public function testSubmitPostOrPutRequestWithEmptyRootFormName($method)
{
$path = tempnam(sys_get_temp_dir(), 'sf2');
$path = tempnam(sys_get_temp_dir(), 'sf');
touch($path);
file_put_contents($path, 'zaza');
@ -691,7 +691,7 @@ class CompoundFormTest extends AbstractFormTest
*/
public function testSubmitPostOrPutRequestWithSingleChildForm($method)
{
$path = tempnam(sys_get_temp_dir(), 'sf2');
$path = tempnam(sys_get_temp_dir(), 'sf');
touch($path);
file_put_contents($path, 'zaza');
@ -728,7 +728,7 @@ class CompoundFormTest extends AbstractFormTest
*/
public function testSubmitPostOrPutRequestWithSingleChildFormUploadedFile($method)
{
$path = tempnam(sys_get_temp_dir(), 'sf2');
$path = tempnam(sys_get_temp_dir(), 'sf');
touch($path);
file_put_contents($path, 'zaza');

View File

@ -45,7 +45,7 @@ class AttributeBagTest extends TestCase
),
),
);
$this->bag = new AttributeBag('_sf2');
$this->bag = new AttributeBag('_sf');
$this->bag->initialize($this->array);
}
@ -67,7 +67,7 @@ class AttributeBagTest extends TestCase
public function testGetStorageKey()
{
$this->assertEquals('_sf2', $this->bag->getStorageKey());
$this->assertEquals('_sf', $this->bag->getStorageKey());
$attributeBag = new AttributeBag('test');
$this->assertEquals('test', $attributeBag->getStorageKey());
}

View File

@ -45,7 +45,7 @@ class MongoDbSessionHandlerTest extends TestCase
'data_field' => 'data',
'time_field' => 'time',
'expiry_field' => 'expires_at',
'database' => 'sf2-test',
'database' => 'sf-test',
'collection' => 'session-test',
);

View File

@ -33,7 +33,7 @@ class PdoSessionHandlerTest extends TestCase
protected function getPersistentSqliteDsn()
{
$this->dbFile = tempnam(sys_get_temp_dir(), 'sf2_sqlite_sessions');
$this->dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_sessions');
return 'sqlite:'.$this->dbFile;
}

View File

@ -35,7 +35,7 @@ class MockFileSessionStorageTest extends TestCase
protected function setUp()
{
$this->sessionDir = sys_get_temp_dir().'/sf2test';
$this->sessionDir = sys_get_temp_dir().'/sftest';
$this->storage = $this->getStorage();
}

View File

@ -36,7 +36,7 @@ class NativeSessionStorageTest extends TestCase
protected function setUp()
{
$this->iniSet('session.save_handler', 'files');
$this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sf2test');
$this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sftest');
if (!is_dir($this->savePath)) {
mkdir($this->savePath);
}

View File

@ -32,7 +32,7 @@ class PhpBridgeSessionStorageTest extends TestCase
protected function setUp()
{
$this->iniSet('session.save_handler', 'files');
$this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sf2test');
$this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sftest');
if (!is_dir($this->savePath)) {
mkdir($this->savePath);
}

View File

@ -20,7 +20,7 @@ class ChainCacheClearerTest extends TestCase
public static function setUpBeforeClass()
{
self::$cacheDir = tempnam(sys_get_temp_dir(), 'sf2_cache_clearer_dir');
self::$cacheDir = tempnam(sys_get_temp_dir(), 'sf_cache_clearer_dir');
}
public static function tearDownAfterClass()

View File

@ -20,7 +20,7 @@ class CacheWarmerAggregateTest extends TestCase
public static function setUpBeforeClass()
{
self::$cacheDir = tempnam(sys_get_temp_dir(), 'sf2_cache_warmer_dir');
self::$cacheDir = tempnam(sys_get_temp_dir(), 'sf_cache_warmer_dir');
}
public static function tearDownAfterClass()

View File

@ -20,7 +20,7 @@ class CacheWarmerTest extends TestCase
public static function setUpBeforeClass()
{
self::$cacheFile = tempnam(sys_get_temp_dir(), 'sf2_cache_warmer_dir');
self::$cacheFile = tempnam(sys_get_temp_dir(), 'sf_cache_warmer_dir');
}
public static function tearDownAfterClass()

View File

@ -22,7 +22,7 @@ class FileProfilerStorageTest extends TestCase
protected function setUp()
{
$this->tmpDir = sys_get_temp_dir().'/sf2_profiler_file_storage';
$this->tmpDir = sys_get_temp_dir().'/sf_profiler_file_storage';
if (is_dir($this->tmpDir)) {
self::cleanDir();
}

View File

@ -84,7 +84,7 @@ class ProfilerTest extends TestCase
protected function setUp()
{
$this->tmp = tempnam(sys_get_temp_dir(), 'sf2_profiler');
$this->tmp = tempnam(sys_get_temp_dir(), 'sf_profiler');
if (file_exists($this->tmp)) {
@unlink($this->tmp);
}

View File

@ -24,7 +24,7 @@ class TranslatorCacheTest extends TestCase
protected function setUp()
{
$this->tmpDir = sys_get_temp_dir().'/sf2_translation';
$this->tmpDir = sys_get_temp_dir().'/sf_translation';
$this->deleteTmpDir();
}