Skip to content

Commit 271d209

Browse files
committed
Add test for non-string constants
1 parent 86f3a9a commit 271d209

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Latest stable version](https://img.shields.io/packagist/v/kubawerlos/php-cs-fixer-custom-fixers.svg?label=current%20version)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)
66
[![PHP version](https://img.shields.io/packagist/php-v/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://php.net)
77
[![License](https://img.shields.io/github/license/kubawerlos/php-cs-fixer-custom-fixers.svg)](LICENSE)
8-
![Tests](https://img.shields.io/badge/tests-3569-brightgreen.svg)
8+
![Tests](https://img.shields.io/badge/tests-3570-brightgreen.svg)
99
[![Downloads](https://img.shields.io/packagist/dt/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)
1010

1111
[![CI status](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/actions/workflows/ci.yaml/badge.svg)](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/actions/workflows/ci.yaml)

tests/Fixer/ClassConstantUsageFixerTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ public function testFix(string $expected, ?string $input = null): void
3636
*/
3737
public static function provideFixCases(): iterable
3838
{
39+
yield 'non-string constants are ignored' => [
40+
<<<'PHP'
41+
<?php
42+
class Foo
43+
{
44+
public const B = true;
45+
public const I = 10;
46+
public function f()
47+
{
48+
return 10 * f1(true, false, true);
49+
}
50+
}
51+
PHP,
52+
];
3953
yield 'multiple constants with the same value' => [
4054
<<<'PHP'
4155
<?php

0 commit comments

Comments
 (0)