File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
src/Symfony/Component/Validator Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -67,14 +67,14 @@ public function write(ClassMetadata $metadata)
67
67
}
68
68
69
69
/**
70
- * Replaces backslashes by underscores in a class name.
70
+ * Replaces backslashes by dots in a class name.
71
71
*
72
72
* @param string $class
73
73
*
74
74
* @return string
75
75
*/
76
76
private function escapeClassName ($ class )
77
77
{
78
- return strtr ($ class , '\\' , '_ ' );
78
+ return strtr ($ class , '\\' , '. ' );
79
79
}
80
80
}
Original file line number Diff line number Diff line change 4
4
5
5
use Symfony \Component \Cache \Adapter \ArrayAdapter ;
6
6
use Symfony \Component \Validator \Mapping \Cache \Psr6Cache ;
7
+ use Symfony \Component \Validator \Mapping \ClassMetadata ;
7
8
8
9
/**
9
10
* @author Kévin Dunglas <dunglas@gmail.com>
@@ -14,4 +15,12 @@ protected function setUp()
14
15
{
15
16
$ this ->cache = new Psr6Cache (new ArrayAdapter ());
16
17
}
18
+
19
+ public function testNameCollision ()
20
+ {
21
+ $ metadata = new ClassMetadata ('Foo \\Bar ' );
22
+
23
+ $ this ->cache ->write ($ metadata );
24
+ $ this ->assertFalse ($ this ->cache ->has ('Foo_Bar ' ));
25
+ }
17
26
}
You can’t perform that action at this time.
0 commit comments