Skip to content

Commit f276ad6

Browse files
committed
Using HEREDOC fixes a PHPStorm warning about ']]>'
1 parent 99f9055 commit f276ad6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/Parser/UserDocParserTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ protected function setUp(): void
2323
/** @test */
2424
public function getManualParts_WithMinimumTags_CreatePartsObject()
2525
{
26-
$content = '
26+
$content = <<<XML
2727
<documentation title="Title">
2828
<rule_code>Rule.Code</rule_code>
2929
<standard>Description</standard>
3030
</documentation>
31-
';
31+
XML;
3232
file_put_contents(self::XML_FILE_PATH, $content);
3333
$parts = $this->parser->getManualParts(self::XML_FILE_PATH);
3434
self::assertEquals(
@@ -45,21 +45,21 @@ public function getManualParts_WithMinimumTags_CreatePartsObject()
4545
/** @test */
4646
public function getManualParts_WithCodeComparisons_AddTrimmedDiffs()
4747
{
48-
$content = '
48+
$content = <<<XML
4949
<documentation title="Title">
5050
<rule_code>Rule.Code</rule_code>
5151
<standard>Description</standard>
5252
<code_comparison>
5353
<code>
5454
<![CDATA[
55-
function a() {
56-
}
55+
function a() {
56+
}
5757
]]>
5858
</code>
5959
<code>
6060
<![CDATA[
61-
function b() {
62-
}
61+
function b() {
62+
}
6363
]]>
6464
</code>
6565
</code_comparison>
@@ -68,7 +68,7 @@ function b() {
6868
<code>b();</code>
6969
</code_comparison>
7070
</documentation>
71-
';
71+
XML;
7272
file_put_contents(self::XML_FILE_PATH, $content);
7373
$parts = $this->parser->getManualParts(self::XML_FILE_PATH);
7474
self::assertEquals(
@@ -83,7 +83,7 @@ function b() {
8383
/** @test */
8484
public function getManualParts_WithLinks_AddLinks()
8585
{
86-
$content = '
86+
$content = <<<XML
8787
<documentation title="Title">
8888
<rule_code>Rule.Code</rule_code>
8989
<standard>Description</standard>
@@ -92,7 +92,7 @@ public function getManualParts_WithLinks_AddLinks()
9292
<link>http://link2.com</link>
9393
</links>
9494
</documentation>
95-
';
95+
XML;
9696
file_put_contents(self::XML_FILE_PATH, $content);
9797
$parts = $this->parser->getManualParts(self::XML_FILE_PATH);
9898
self::assertEquals(

0 commit comments

Comments
 (0)