Skip to content

Mark the test suites and test cases internal - #284

Merged
danog merged 5 commits into
psalm:masterfrom
danog:mark-test-code-internal
Nov 16, 2026
Merged

danog merged 5 commits into
psalm:masterfrom
danog:mark-test-code-internal

Conversation

@danog

@danog danog commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

The test suites of phpunit.xml and the test cases aren't internal, so library code may use them, and with Psalm's markAllNonInternalCodeAsApi (vimeo/psalm#13939) they count as the library's API, hiding their unused code.

Before

<?php
// tests/Helper.php, in a test suite of phpunit.xml
namespace Tests;

final class Helper {}

// code.php
namespace NS;

final class Client
{
  public function send(): void
  {
    new \Tests\Helper(); // no issue
  }
}

After

    new \Tests\Helper(); // InternalClass

The DeadCode.feature scenarios set markAllNonInternalCodeAsApi, which needs vimeo/psalm#13939 merged.

@danog danog added the release:feature The PR will be included in 'Features' section of the release notes label Nov 16, 2026
@danog danog changed the title Mark the test suites and test cases internal with markAllNonInternalCodeAsApi Mark the test suites and test cases internal Nov 16, 2026
@danog
danog force-pushed the mark-test-code-internal branch from 0adab2e to a23c3c4 Compare November 16, 2026 16:10
@danog
danog merged commit 88899af into psalm:master Nov 16, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:feature The PR will be included in 'Features' section of the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant