TestLinkNavigate Tests β Production
Cmd+Click to jump between your tests and production code. Instantly.
Cmd+Click to jump between your tests and production code. Instantly.
No more searching for tests. Cmd+Click any @see tag to jump directly to the related code.
From production code, click to see which tests verify it. From tests, click to see which production code they cover. Both directions, instantly navigable.
class UserService
{
/**
* @see \Tests\UserServiceTest::creates_user β Cmd+Click
* @see \Tests\UserServiceTest::validates_email β Cmd+Click
*/
public function create(array $data): User
{
// Which tests verify this method? Just click above.
}
}/**
* @see \App\Services\UserService::create β Cmd+Click
*/
test('creates user', function () {
// What does this test cover? Just click above.
});One method tested by 5 different tests? See them all at a glance.
One test covers multiple methods? Visible instantly. No more guessing which code is tested, or which tests cover what.
/**
* @see \Tests\OrderServiceTest::creates_order
* @see \Tests\OrderServiceTest::validates_items
* @see \Tests\OrderServiceTest::calculates_total
* @see \Tests\OrderFlowTest::complete_checkout
* @see \Tests\OrderFlowTest::payment_flow
*/
public function create(array $items): Order
{
// 5 tests verify this method - all visible here
}$ ./vendor/bin/testlink report
OrderService
create()
β OrderServiceTest::creates_order
β OrderServiceTest::validates_items
β OrderServiceTest::calculates_total
β OrderFlowTest::complete_checkout
β OrderFlowTest::payment_flow
Summary
βββββββ
Methods with tests: 1
Total test links: 5
@see tags: 0
β Report complete.Works with your existing framework. Pest method chains, PHPUnit attributes, or @see tags.
Mix all three in the same project. TestLink recognizes them all.
test('creates user', function () {
// ...
})->linksAndCovers(UserService::class.'::create');Renamed a method? Deleted a test? Validation catches broken links instantly.
Run in CI/CD to ensure your navigation links stay accurate as code evolves.
$ ./vendor/bin/testlink validate
Validation Report
βββββββββββββββββ
Orphan @see Tags
β UserServiceTest::old_name
β src/UserService.php:15
Summary
βββββββ
PHPUnit attribute links: 10
Pest method chain links: 5
@see tags: 8
Total links: 23
Issues found: 1
Orphan @see tags: 1
β Validation complete with issues.Don't manually maintain links. Sync generates them bidirectionally.
Add a link on either sideβproduction or testsβand testlink sync propagates it to the other side. Start from whichever side feels natural for your workflow.
$ ./vendor/bin/testlink sync
Syncing Coverage Links
ββββββββββββββββββββββ
Modified Files
β src/Services/UserService.php (1 change)
+ #[TestedBy(UserServiceTest::class, 'creates_user')]
β tests/Unit/OrderServiceTest.php (1 change)
+ linksAndCovers(OrderService::class.'::process')
Summary
βββββββ
Files modified: 2
Files pruned: 0
@see tags added: 0
@see tags removed: 0
#[TestedBy] added: 1
β Sync complete.Writing tests before classes exist? Use @placeholder markers.
During rapid TDD, you don't know the final class name yet. Use placeholders like @user-create in both test and production code, then resolve them with testlink pair.
// Test written BEFORE the class exists
test('calculates discount', function () {
$calc = new PriceCalculator();
expect($calc->calculate(100, 0.1))->toBe(90);
})->linksAndCovers('@discount');
// Production code (written after test passes)
#[TestedBy('@discount')]
public function calculate(int $price, float $discount): int
{
return (int) ($price * (1 - $discount));
}$ ./vendor/bin/testlink pair
Pairing Placeholders
ββββββββββββββββββββ
Found Placeholders
β @discount 1 production Γ 1 tests = 1 links
Summary
βββββββ
Placeholders resolved: 1
Total changes: 2
Files modified: 2
β Pairing complete.Short class names in @see tags? Fix them automatically.
TestLink detects non-FQCN references and resolves them using your use statements. One command converts UserService::create to \App\Services\UserService::create.
// Before: Short class name (IDE can't navigate)
/**
* @see UserServiceTest::creates_user
*/
public function create(): User { }
// After: FQCN (Cmd+Click works!)
/**
* @see \Tests\Unit\UserServiceTest::creates_user
*/
public function create(): User { }$ ./vendor/bin/testlink validate --fix
Validation Report
βββββββββββββββββ
FQCN Conversion Results
β src/TestLink/UserService.php
+ Tests\TestLink\UserServiceTest::creates
β \Tests\TestLink\UserServiceTest::creates
β Converted 1 @see tag(s) in 1 file(s).
Summary
βββββββ
PHPUnit attribute links: 5
Pest method chain links: 3
@see tags: 4
Total links: 12
Issues fixed: 1
β Validation complete. All links are valid!