8000 minor #11963 Fixing unit tests (fejese) · alexpott/symfony@cd9ae6f · GitHub
[go: up one dir, main page]

Skip to content

Commit cd9ae6f

Browse files
committed
minor symfony#11963 Fixing unit tests (fejese)
This PR was merged into the 2.6-dev branch. Discussion ---------- Fixing unit tests [Validator] Fixing how default time zone is backed up during testing to not interfere with other tests [HttpKernel] Fixing merge issue since 4677e92 | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 5b3193a minor symfony#11963 Unit test fixes [HttpKernel] Fixing unit test broken since merge 4677e92 [Validator] Fixing the way the default time zone is backed up
2 parents b0b325b + 5b3193a commit cd9ae6f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function testProcess()
106106
$response = new Response('foo <esi:comment text="some comment" /><esi:include src="foo\'" alt="bar\'" onerror="continue" />');
107107
$esi->process($request, $response);
108108

109-
$this->assertEquals("foo <?php echo \$this->esi->handle(\$this, 'foo\\'', 'bar\\'', true) ?>"."\n", $response->getContent());
109+
$this->assertEquals('foo <?php echo $this->surrogate->handle($this, \'foo\\\'\', \'bar\\\'\', true) ?>'."\n", $response->getContent());
110110

111111
$response = new Response('foo <esi:include src="..." />');
112112
$esi->process($request, $response);

src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ protected function setDefaultTimezone($defaultTimezone)
9090
// Make sure this method can not be called twice before calling
9191
// also restoreDefaultTimezone()
9292
if (null === $this->defaultTimezone) {
93-
$this->defaultTimezone = ini_get('date.timezone');
94-
ini_set('date.timezone', $defaultTimezone);
93+
$this->defaultTimezone = date_default_timezone_get();
94+
date_default_timezone_set($defaultTimezone);
9595
}
9696
}
9797

9898
protected function restoreDefaultTimezone()
9999
{
100100
if (null !== $this->defaultTimezone) {
101-
ini_set('date.timezone', $this->defaultTimezone);
101+
date_default_timezone_set($this->defaultTimezone);
102102
$this->defaultTimezone = null;
103103
}
104104
}
@@ -116,7 +116,7 @@ protected function createContext()
116116
$this->metadata,
117117
$this->value,
118118
$this->group,
119-
$this->propertyPath
119+
$this->propertyPath,
120120
))
121121
->setMethods(array('validate', 'validateValue'))
122122
->getMock();

0 commit comments

Comments
 (0)
0