Merge branch '2.6' into 2.7

* 2.6:
  fixed typo
  Fixed minor typo - override
  [Filesystem] enforce umask while testing
  [TwigBridge] moved fixtures into their own directory
  Use $this->iniSet() in tests
This commit is contained in:
Nicolas Grekas 2015-01-03 23:52:01 +01:00
commit 7e660fdead
13 changed files with 11 additions and 10 deletions

View File

@ -42,7 +42,7 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
$loader = new StubFilesystemLoader(array( $loader = new StubFilesystemLoader(array(
__DIR__.'/../../Resources/views/Form', __DIR__.'/../../Resources/views/Form',
__DIR__, __DIR__.'/Fixtures/templates/form',
)); ));
$environment = new \Twig_Environment($loader, array('strict_variables' => true)); $environment = new \Twig_Environment($loader, array('strict_variables' => true));

View File

@ -41,7 +41,7 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest
$loader = new StubFilesystemLoader(array( $loader = new StubFilesystemLoader(array(
__DIR__.'/../../Resources/views/Form', __DIR__.'/../../Resources/views/Form',
__DIR__, __DIR__.'/Fixtures/templates/form',
)); ));
$environment = new \Twig_Environment($loader, array('strict_variables' => true)); $environment = new \Twig_Environment($loader, array('strict_variables' => true));

View File

@ -62,17 +62,14 @@ class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase
public function testUnsilencing() public function testUnsilencing()
{ {
ob_start(); ob_start();
$bak = array(
ini_set('log_errors', 0), $this->iniSet('log_errors', 0);
ini_set('display_errors', 1), $this->iniSet('display_errors', 1);
);
// See below: this will fail with parse error // See below: this will fail with parse error
// but this should not be @-silenced. // but this should not be @-silenced.
@class_exists(__NAMESPACE__.'\TestingUnsilencing', true); @class_exists(__NAMESPACE__.'\TestingUnsilencing', true);
ini_set('log_errors', $bak[0]);
ini_set('display_errors', $bak[1]);
$output = ob_get_clean(); $output = ob_get_clean();
$this->assertStringMatchesFormat('%aParse error%a', $output); $this->assertStringMatchesFormat('%aParse error%a', $output);

View File

@ -25,7 +25,7 @@ class ExpressionLanguage extends BaseExpressionLanguage
{ {
public function __construct(ParserCacheInterface $cache = null, array $providers = array()) public function __construct(ParserCacheInterface $cache = null, array $providers = array())
{ {
// prepend the default provider to let users overide it easily // prepend the default provider to let users override it easily
array_unshift($providers, new ExpressionLanguageProvider()); array_unshift($providers, new ExpressionLanguageProvider());
parent::__construct($cache, $providers); parent::__construct($cache, $providers);

View File

@ -13,6 +13,8 @@ namespace Symfony\Component\Filesystem\Tests;
class FilesystemTestCase extends \PHPUnit_Framework_TestCase class FilesystemTestCase extends \PHPUnit_Framework_TestCase
{ {
private $umask;
/** /**
* @var string $workspace * @var string $workspace
*/ */
@ -37,6 +39,7 @@ class FilesystemTestCase extends \PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
$this->umask = umask(0);
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().rand(0, 1000); $this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().rand(0, 1000);
mkdir($this->workspace, 0777, true); mkdir($this->workspace, 0777, true);
$this->workspace = realpath($this->workspace); $this->workspace = realpath($this->workspace);
@ -45,6 +48,7 @@ class FilesystemTestCase extends \PHPUnit_Framework_TestCase
public function tearDown() public function tearDown()
{ {
$this->clean($this->workspace); $this->clean($this->workspace);
umask($this->umask);
} }
/** /**

View File

@ -25,7 +25,7 @@ class ExpressionLanguage extends BaseExpressionLanguage
{ {
public function __construct(ParserCacheInterface $cache = null, array $providers = array()) public function __construct(ParserCacheInterface $cache = null, array $providers = array())
{ {
// prepend the default provider to let users overide it easily // prepend the default provider to let users override it easily
array_unshift($providers, new ExpressionLanguageProvider()); array_unshift($providers, new ExpressionLanguageProvider());
parent::__construct($cache, $providers); parent::__construct($cache, $providers);