Skip to content

Commit d17b333

Browse files
committed
minor #32404 [Validator] remove tests for legacy behaviour (xabbuh)
This PR was merged into the 5.0-dev branch. Discussion ---------- [Validator] remove tests for legacy behaviour | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- d6d4aba remove tests for legacy behaviour
2 parents 123d5b2 + d6d4aba commit d17b333

File tree

3 files changed

+1
-48
lines changed

3 files changed

+1
-48
lines changed

src/Symfony/Component/Validator/ConstraintViolation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function __toString()
8484
$class .= '.';
8585
}
8686

87-
if ('' !== $code = (string) $this->code) {
87+
if (null !== $this->code && '' !== $code = $this->code) {
8888
$code = ' (code '.$code.')';
8989
}
9090

src/Symfony/Component/Validator/Tests/ConstraintViolationTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,4 @@ public function testToStringOmitsEmptyCodes()
108108

109109
$this->assertSame($expected, (string) $violation);
110110
}
111-
112-
public function testNonStringCode()
113-
{
114-
$violation = new ConstraintViolation(
115-
'42 cannot be used here',
116-
'this is the message template',
117-
[],
118-
['some_value' => 42],
119-
'some_value',
120-
null,
121-
null,
122-
42
123-
);
124-
125-
self::assertSame('42', $violation->getCode());
126-
}
127111
}

src/Symfony/Component/Validator/Tests/Violation/ConstraintViolationBuilderTest.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)