8000 Replace gender by eye color in tests · symfony/symfony@7218034 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7218034

Browse files
author
Raphaëll Roussel
committed
Replace gender by eye color in tests
1 parent afb7bb5 commit 7218034

File tree

9 files changed

+27
-27
lines changed

9 files changed

+27
-27
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Author.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
class Author
66
{
7-
public $gender;
7+
public $eyeColor;
88
}

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Person.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
class Person
66
{
7-
public $gender;
7+
public $eyeColor;
88
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Serialization\Author:
22
attributes:
3-
gender:
3+
eyeColor:
44
groups: ['group1', 'group2']

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Resources/person.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
http://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd"
66
>
77
<class name="Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Serialization\Person">
8-
<attribute name="gender">
8+
<attribute name="eyeColor">
99
<group>group1</group>
1010
<group>group2</group>
1111
</attribute>

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Author.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
class Author
66
{
7-
public $gender;
7+
public $eyeColor;
88
}

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Person.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
class Person
66
{
7-
public $gender;
7+
public $eyeColor;
88
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation\Author:
22
properties:
3-
gender:
4-
- Choice: { choices: [male, female, other], message: Choose a valid gender. }
3+
eyeColor:
4+
- Choice: { choices: [brown, green, blue], message: Choose a valid eye color. }

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Resources/person.xml

Lines changed: 5 additions & 5 deletions
< F438 /tr>
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
55

66
<class name="Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation\Person">
7-
<property name="gender">
7+
<property name="eyeColor">
88
<constraint name="Choice">
99
<option name="choices">
10-
<value>male</value>
11< 1E0A code class="diff-text syntax-highlighted-line deletion">-
<value>female</value>
12-
<value>other</value>
10+
<value>brown</value>
11+
<value>green</value>
12+
<value>blue</value>
1313
</option>
14-
<option name="message">Choose a valid gender.</option>
14+
<option name="message">Choose a valid eye color.</option>
1515
</constraint>
1616
</property>
1717
</class>

src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,11 @@ public function testEncodeScalarRootAttributes()
190190
{
191191
$array = [
192192
'#' => 'Paul',
193-
'@gender' => 'm',
193+
'@eye-color' => 'brown',
194194
];
195195

196196
$expected = '<?xml version="1.0"?>'."\n".
197-
'<response gender="m">Paul</response>'."\n";
197+
'<response eye-color="brown">Paul</response>'."\n";
198198

199199
$this->assertEquals($expected, $this->encoder->encode($array, 'xml'));
200200
}
@@ -203,11 +203,11 @@ public function testEncodeRootAttributes()
203203
{
204204
$array = [
205205
'firstname' => 'Paul',
206-
'@gender' => 'm',
206+
'@eye-color' => 'brown',
207207
];
208208

209209
$expected = '<?xml version="1.0"?>'."\n".
210-
'<response gender="m"><firstname>Paul</firstname></response>'."\n";
210+
'<response eye-color="brown"><firstname>Paul</firstname></response>'."\n";
211211

212212
$this->assertEquals($expected, $this->encoder->encode($array, 'xml'));
213213
}
@@ -227,11 +227,11 @@ public function testEncodeCdataWrapping()
227227
public function testEncodeScalarWithAttribute()
228228
{
229229
$array = [
230-
'person' => ['@gender' => 'M', '#' => 'Peter'],
230+
'person' => ['@eye-color' => 'brown', '#' => 'Peter'],
231231
];
232232

233233
$expected = '<?xml version="1.0"?>'."\n".
234-
'<response><person gender="M">Peter</person></response>'."\n";
234+
'<response><person eye-color="brown">Peter</person></response>'."\n";
235235

236236
$this->assertEquals($expected, $this->encoder->encode($array, 'xml'));
237237
}
@@ -330,11 +330,11 @@ public function testEncodeSerializerXmlRootNodeNameOption()
330330
$this->encoder->setSerializer($serializer);
331331

332332
$array = [
333-
'person' => ['@gender' => 'M', '#' => 'Peter'],
333+
'person' => ['@eye-color' => 'brown', '#' => 'Peter'],
334334
];
335335

336336
$expected = '<?xml version="1.0"?>'."\n".
337-
'<test><person gender="M">Peter</person></test>'."\n";
337+
'<test><person eye-color="brown">Peter</person></test>'."\n";
338338

339339
$this->assertEquals($expected, $serializer->serialize($array, 'xml', $options));
340340
}
@@ -398,10 +398,10 @@ public function testDecodeWithNamespace()
398398
public function testDecodeScalarWithAttribute()
399399
{
400400
$source = '<?xml version="1.0"?>'."\n".
401-
'<response><person gender="M">Peter</person></response>'."\n";
401+
'<response><person eye-color="brown">Peter</person></response>'."\n";
402402

403403
$expected = [
404-
'person' => ['@gender' => 'M', '#' => 'Peter'],
404+
'person' => ['@eye-color' => 'brown', '#' => 'Peter'],
405405
];
406406

407407
$this->assertEquals($expected, $this->encoder->decode($source, 'xml'));
@@ -410,11 +410,11 @@ public function testDecodeScalarWithAttribute()
410410
public function testDecodeScalarRootAttributes()
411411
{
412412
$source = '<?xml version="1.0"?>'."\n".
413-
'<person gender="M">Peter</person>'."\n";
413+
'<person eye-color="brown">Peter</person>'."\n";
414414

415415
$expected = [
416416
'#' => 'Peter',
417-
'@gender' => 'M',
417+
'@eye-color' => 'brown',
418418
];
419419

420420
$this->assertEquals($expected, $this->encoder->decode($source, 'xml'));
@@ -423,12 +423,12 @@ public function testDecodeScalarRootAttributes()
423423
public function testDecodeRootAttributes()
424424
{
425425
$source = '<?xml version="1.0"?>'."\n".
426-
'<person gender="M"><firstname>Peter</firstname><lastname>Mac Calloway</lastname></person>'."\n";
426+
'<person eye-color="brown"><firstname>Peter</firstname><lastname>Mac Calloway</lastname></person>'."\n";
427427

428428
$expected = [
429429
'firstname' => 'Peter',
430430
'lastname' => 'Mac Calloway',
431-
'@gender' => 'M',
431+
'@eye-color' => 'brown',
432432
];
433433

434434
$this->assertEquals($expected, $this->encoder->decode($source, 'xml'));

0 commit comments

Comments
 (0)
0