Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos committed Jan 23, 2024
1 parent a996334 commit 0153cf8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![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)
[![PHP version](https://img.shields.io/packagist/php-v/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://php.net)
[![License](https://img.shields.io/github/license/kubawerlos/php-cs-fixer-custom-fixers.svg)](LICENSE)
![Tests](https://img.shields.io/badge/tests-3526-brightgreen.svg)
![Tests](https://img.shields.io/badge/tests-3527-brightgreen.svg)
[![Downloads](https://img.shields.io/packagist/dt/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)

[![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)
Expand Down
8 changes: 8 additions & 0 deletions tests/Fixer/NoImportFromGlobalNamespaceFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,14 @@ function Bar() {}
namespace N6; use DateTime; use stdClass; new DateTime(); new stdClass();
',
];

$expected = "<?php\nnamespace Foo;\n";
$input = "<?php\nnamespace Foo;\n use Bar;\n";
for ($i = 1; $i <= 5; $i++) {
$expected .= \sprintf("echo \\Bar::BAZ_%d;\n", $i);
$input .= \sprintf("echo Bar::BAZ_%d;\n", $i);
}
yield [$expected, $input];
}

/**
Expand Down

0 comments on commit 0153cf8

Please sign in to comment.