Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify a few tests using named parameters #769

Merged
merged 1 commit into from
Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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