8000 Merge branch '2.5' into 2.6 · symfony/symfony@fb23abe · GitHub
[go: up one dir, main page]

Skip to content

Commit fb23abe

Browse files
committed
Merge branch '2.5' into 2.6
* 2.5: [Filesystem] enforce umask while testing [TwigBridge] moved fixtures into their own directory Use $this->iniSet() in tests
2 parents f14c7ca + 6537359 commit fb23abe

File tree

11 files changed

+9
-8
lines changed

11 files changed

+9
-8
lines changed

src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function setUp()
4242

4343
$loader = new StubFilesystemLoader(array(
4444
__DIR__.'/../../Resources/views/Form',
45-
__DIR__,
45+
__DIR__.'/Fixtures/templates/form',
4646
));
4747

4848
$environment = new \Twig_Environment($loader, array('strict_variables' => true));

src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function setUp()
4141

4242
$loader = new StubFilesystemLoader(array(
4343
__DIR__.'/../../Resources/views/Form',
44-
__DIR__,
44+
__DIR__.'/Fixtures/templates/form',
4545
));
4646

4747
$environment = new \Twig_Environment($loader, array('strict_variables' => true));

src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,14 @@ public function testIdempotence()
6262
public function testUnsilencing()
6363
{
6464
ob_start();
65-
$bak = array(
66-
ini_set('log_errors', 0),
67-
ini_set('display_errors', 1),
68-
);
65+
66+
$this->iniSet('log_errors', 0);
67+
$this->iniSet('display_errors', 1);
6968

7069
// See below: this will fail with parse error
7170
// but this should not be @-silenced.
7271
@class_exists(__NAMESPACE__.'\TestingUnsilencing', true);
7372

74-
ini_set('log_errors', $bak[0]);
75-
ini_set('display_errors', $bak[1]);
7673
$output = ob_get_clean();
7774

7875
$this->assertStringMatchesFormat('%aParse error%a', $output);

src/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
class FilesystemTestCase extends \PHPUnit_Framework_TestCase
1515
{
16+
private $umask;
17+
1618
/**
1719
* @var string $workspace
1820
*/
@@ -37,6 +39,7 @@ public static function setUpBeforeClass()
3739

3840
public function setUp()
3941
{
42+
$this->umask = umask(0);
4043
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().rand(0, 1000);
4144
mkdir($this->workspace, 0777, true);
4245
$this->workspace = realpath($this->workspace);
@@ -45,6 +48,7 @@ public function setUp()
4548
public function tearDown()
4649
{
4750
$this->clean($this->workspace);
51+
umask($this->umask);
4852
}
4953

5054
/**

0 commit comments

Comments
 (0)
0