Skip to content

Commit

Permalink
Simplify a few tests using named parameters (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Nov 13, 2022
1 parent 3dc5aa3 commit 8ba7d27
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
1 change: 0 additions & 1 deletion tests/PhpScoperAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public static function assertListEqualsCanonicalizing(
): void {
Assert::assertIsArray($actual);

// TODO: contribute this to PHPUnit
// TODO: use assertArrayIsList() assertion once available
// https://github.com/sebastianbergmann/phpunit/commit/71f507496aa1a483b32d9257d6f3477e6e5c091d
Assert::assertTrue(
Expand Down
6 changes: 1 addition & 5 deletions tests/Scoper/Composer/InstalledPackagesScoperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,8 @@ public static function provideInstalledPackagesFiles(): iterable
yield 'fideloper/proxy excerpt with excluded provider' => [
new EnrichedReflector(
Reflector::createEmpty(),
// TODO: named params
SymbolsConfiguration::create(
false,
false,
false,
NamespaceRegistry::create(['Fideloper']),
excludedNamespaces: NamespaceRegistry::create(['Fideloper']),
),
),
<<<'JSON'
Expand Down
15 changes: 3 additions & 12 deletions tests/Symbol/EnrichedReflectorFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,10 @@ final class EnrichedReflectorFactoryTest extends TestCase
{
public function test_it_can_create_an_enriched_reflector(): void
{
// TODO: named param could help here
$symbolsConfiguration = SymbolsConfiguration::create(
false,
false,
false,
null,
null,
null,
null,
null,
SymbolRegistry::create(['Acme\Foo']),
SymbolRegistry::create(['Acme\main']),
SymbolRegistry::createForConstants(['Acme\BAR']),
excludedClasses: SymbolRegistry::create(['Acme\Foo']),
excludedFunctions: SymbolRegistry::create(['Acme\main']),
excludedConstants: SymbolRegistry::createForConstants(['Acme\BAR']),
);

$factory = new EnrichedReflectorFactory(Reflector::createEmpty());
Expand Down

0 comments on commit 8ba7d27

Please sign in to comment.