bug #10904 [HttpKernel] Replace sha1 with sha256 in recently added tests (jakzal)
This PR was merged into the 2.4 branch.
Discussion
----------
[HttpKernel] Replace sha1 with sha256 in recently added tests
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | -
| License | MIT
Tests were introduced in #10896 and are broken starting with 2.4, since the hashing algorithm has changed (introduced in #8609).
Commits
-------
255544f
[HttpKernel] Replace sha1 with sha256 in recently added tests.
This commit is contained in:
commit
be3c0dcfc0
|
@ -609,12 +609,11 @@ class HttpCacheTest extends HttpCacheTestCase
|
|||
$values = $this->getMetaStorageValues();
|
||||
$this->assertCount(1, $values);
|
||||
$tmp = unserialize($values[0]);
|
||||
$time = \DateTime::createFromFormat('U', time());
|
||||
$tmp[0][1]['date'] = \DateTime::createFromFormat('U', time() - 5)->format(DATE_RFC2822);
|
||||
$r = new \ReflectionObject($this->store);
|
||||
$m = $r->getMethod('save');
|
||||
$m->setAccessible(true);
|
||||
$m->invoke($this->store, 'md'.sha1('http://localhost/'), serialize($tmp));
|
||||
$m->invoke($this->store, 'md'.hash('sha256', 'http://localhost/'), serialize($tmp));
|
||||
|
||||
$this->request('GET', '/');
|
||||
$this->assertHttpKernelIsCalled();
|
||||
|
@ -659,12 +658,11 @@ class HttpCacheTest extends HttpCacheTestCase
|
|||
$values = $this->getMetaStorageValues();
|
||||
$this->assertCount(1, $values);
|
||||
$tmp = unserialize($values[0]);
|
||||
$time = \DateTime::createFromFormat('U', time());
|
||||
$tmp[0][1]['date'] = \DateTime::createFromFormat('U', time() - 5)->format(DATE_RFC2822);
|
||||
$r = new \ReflectionObject($this->store);
|
||||
$m = $r->getMethod('save');
|
||||
$m->setAccessible(true);
|
||||
$m->invoke($this->store, 'md'.sha1('http://localhost/'), serialize($tmp));
|
||||
$m->invoke($this->store, 'md'.hash('sha256', 'http://localhost/'), serialize($tmp));
|
||||
|
||||
$this->request('GET', '/');
|
||||
$this->assertHttpKernelIsCalled();
|
||||
|
|
Reference in New Issue