Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit37e02af

Browse files
committed
relax assertions on generated hashes
1 parentc427887 commit37e02af

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

‎src/Symfony/Component/HttpKernel/Tests/Fragment/EsiFragmentRendererTest.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public function testRenderControllerReference()
6060
$reference =newControllerReference('main_controller', [], []);
6161
$altReference =newControllerReference('alt_controller', [], []);
6262

63-
$this->assertEquals(
64-
'<esi:include src="/_fragment?_hash=Jz1P8NErmhKTeI6onI1EdAXTB85359MY3RIk5mSJ60w%3D&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller" alt="/_fragment?_hash=iPJEdRoUpGrM1ztqByiorpfMPtiW%2FOWwdH1DBUXHhEc%3D&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dalt_controller" />',
63+
$this->assertMatchesRegularExpression(
64+
'#^<esi:include src="/_fragment\?_hash=.+&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller" alt="/_fragment\?_hash=.+&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dalt_controller" />$#',
6565
$strategy->render($reference,$request, ['alt' =>$altReference])->getContent()
6666
);
6767
}
@@ -78,8 +78,8 @@ public function testRenderControllerReferenceWithAbsoluteUri()
7878
$reference =newControllerReference('main_controller', [], []);
7979
$altReference =newControllerReference('alt_controller', [], []);
8080

81-
$this->assertSame(
82-
'<esi:include src="http://localhost/_fragment?_hash=Jz1P8NErmhKTeI6onI1EdAXTB85359MY3RIk5mSJ60w%3D&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller" alt="http://localhost/_fragment?_hash=iPJEdRoUpGrM1ztqByiorpfMPtiW%2FOWwdH1DBUXHhEc%3D&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dalt_controller" />',
81+
$this->assertMatchesRegularExpression(
82+
'#^<esi:include src="http://localhost/_fragment\?_hash=.+&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller" alt="http://localhost/_fragment\?_hash=.+&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dalt_controller" />$#',
8383
$strategy->render($reference,$request, ['alt' =>$altReference,'absolute_uri' =>true])->getContent()
8484
);
8585
}

‎src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testRenderWithControllerAndSigner()
3232
{
3333
$strategy =newHIncludeFragmentRenderer(null,newUriSigner('foo'));
3434

35-
$this->assertEquals('<hx:include src="/_fragment?_hash=BP%2BOzCD5MRUI%2BHJpgPDOmoju00FnzLhP3TGcSHbbBLs%3D&amp;_path=_format%3Dhtml%26_locale%3Den%26_controller%3Dmain_controller"></hx:include>',$strategy->render(newControllerReference('main_controller', [], []), Request::create('/'))->getContent());
35+
$this->assertMatchesRegularExpression('#^<hx:include src="/_fragment\?_hash=.+&amp;_path=_format%3Dhtml%26_locale%3Den%26_controller%3Dmain_controller"></hx:include>$#',$strategy->render(newControllerReference('main_controller', [], []), Request::create('/'))->getContent());
3636
}
3737

3838
publicfunctiontestRenderWithUri()

‎src/Symfony/Component/HttpKernel/Tests/Fragment/SsiFragmentRendererTest.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public function testRenderControllerReference()
5151
$reference =newControllerReference('main_controller', [], []);
5252
$altReference =newControllerReference('alt_controller', [], []);
5353

54-
$this->assertEquals(
55-
'<!--#include virtual="/_fragment?_hash=Jz1P8NErmhKTeI6onI1EdAXTB85359MY3RIk5mSJ60w%3D&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller" -->',
54+
$this->assertMatchesRegularExpression(
55+
'{^<!--#include virtual="/_fragment\?_hash=.+&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller" -->$}',
5656
$strategy->render($reference,$request, ['alt' =>$altReference])->getContent()
5757
);
5858
}
@@ -69,8 +69,8 @@ public function testRenderControllerReferenceWithAbsoluteUri()
6969
$reference =newControllerReference('main_controller', [], []);
7070
$altReference =newControllerReference('alt_controller', [], []);
7171

72-
$this->assertSame(
73-
'<!--#include virtual="http://localhost/_fragment?_hash=Jz1P8NErmhKTeI6onI1EdAXTB85359MY3RIk5mSJ60w%3D&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller" -->',
72+
$this->assertMatchesRegularExpression(
73+
'{^<!--#include virtual="http://localhost/_fragment\?_hash=.+&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller" -->$}',
7474
$strategy->render($reference,$request, ['alt' =>$altReference,'absolute_uri' =>true])->getContent()
7575
);
7676
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp