From e783c33d540301200130307d8baba8bfbfbeb634 Mon Sep 17 00:00:00 2001 From: Kieu Anh Tuan Date: Thu, 14 Feb 2013 15:07:49 +0100 Subject: [PATCH 1/2] Add PropertyNamingStrategy --- .../Serializer/Naming/PropertyNamingStrategy.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/JMS/Serializer/Naming/PropertyNamingStrategy.php diff --git a/src/JMS/Serializer/Naming/PropertyNamingStrategy.php b/src/JMS/Serializer/Naming/PropertyNamingStrategy.php new file mode 100644 index 000000000..8d1bd20c8 --- /dev/null +++ b/src/JMS/Serializer/Naming/PropertyNamingStrategy.php @@ -0,0 +1,13 @@ +name; + } +} From 136793fe636e60b7a882804acfff279ba23f33c6 Mon Sep 17 00:00:00 2001 From: Kieu Anh Tuan Date: Thu, 14 Feb 2013 15:55:41 +0100 Subject: [PATCH 2/2] Rename and add test cases --- ...hp => IdenticalPropertyNamingStrategy.php} | 4 +-- .../IdenticalPropertyNamingStrategyTest.php | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) rename src/JMS/Serializer/Naming/{PropertyNamingStrategy.php => IdenticalPropertyNamingStrategy.php} (65%) create mode 100644 tests/JMS/Serializer/Tests/Serializer/Naming/IdenticalPropertyNamingStrategyTest.php diff --git a/src/JMS/Serializer/Naming/PropertyNamingStrategy.php b/src/JMS/Serializer/Naming/IdenticalPropertyNamingStrategy.php similarity index 65% rename from src/JMS/Serializer/Naming/PropertyNamingStrategy.php rename to src/JMS/Serializer/Naming/IdenticalPropertyNamingStrategy.php index 8d1bd20c8..febb81435 100644 --- a/src/JMS/Serializer/Naming/PropertyNamingStrategy.php +++ b/src/JMS/Serializer/Naming/IdenticalPropertyNamingStrategy.php @@ -1,10 +1,10 @@ getMockBuilder('JMS\Serializer\Metadata\PropertyMetadata')->disableOriginalConstructor()->getMock(); + $mockProperty->name = $propertyName; + + $strategy = new IdenticalPropertyNamingStrategy(); + $this->assertEquals($propertyName, $strategy->translateName($mockProperty)); + } +} \ No newline at end of file