forked from php-soap/encoding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhpPropertyNameNormalizerTest.php
More file actions
31 lines (26 loc) · 939 Bytes
/
Copy pathPhpPropertyNameNormalizerTest.php
File metadata and controls
31 lines (26 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
declare(strict_types=1);
namespace Soap\Encoding\Test\Unit\Normalizer;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Soap\Encoding\Normalizer\PhpPropertyNameNormalizer;
#[CoversClass(PhpPropertyNameNormalizer::class)]
final class PhpPropertyNameNormalizerTest extends TestCase
{
#[DataProvider('provideCases')]
public function test_it_can_normalize(string $in, string $expected): void
{
static::assertEquals($expected, PhpPropertyNameNormalizer::normalize($in));
}
public static function provideCases()
{
yield ['prop1', 'prop1'];
yield ['final', 'final'];
yield ['Final', 'Final'];
yield ['UpperCased', 'UpperCased'];
yield ['my-./*prop_123', 'myProp_123'];
yield ['My-./*prop_123', 'MyProp_123'];
yield ['My-./final*prop_123', 'MyFinalProp_123'];
}
}