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:
commit
7e660fdead
@ -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));
|
||||||
|
@ -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));
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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);
|
||||||
|
Reference in New Issue
Block a user