1<?php
2
3declare(strict_types=1);
4
5namespace JMS\Serializer\Tests\Serializer\Naming;
6
7use JMS\Serializer\Naming\IdenticalPropertyNamingStrategy;
8use PHPUnit\Framework\TestCase;
9
10class IdenticalPropertyNamingStrategyTest extends TestCase
11{
12    public function providePropertyNames()
13    {
14        return [
15            ['createdAt'],
16            ['my_field'],
17            ['identical'],
18        ];
19    }
20
21    /**
22     * @dataProvider providePropertyNames
23     */
24    public function testTranslateName($propertyName)
25    {
26        $mockProperty = $this->getMockBuilder('JMS\Serializer\Metadata\PropertyMetadata')->disableOriginalConstructor()->getMock();
27        $mockProperty->name = $propertyName;
28
29        $strategy = new IdenticalPropertyNamingStrategy();
30        self::assertEquals($propertyName, $strategy->translateName($mockProperty));
31    }
32}
33