Skip to content
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
2 changes: 1 addition & 1 deletion docs/add-new-adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function testYourDetector(array $files, ?string $expectedName): void

if ($expectedName) {
$this->assertNotNull($detected);
$this->assertEquals($expectedName, $detected->getName());
$this->assertSame($expectedName, $detected->getName());
} else {
$this->assertNull($detected);
}
Expand Down
44 changes: 22 additions & 22 deletions tests/unit/DetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testDetectPackager(array $files, ?string $expectedPackager): voi
$detectedPackager = $detector->detect();

if ($expectedPackager) {
$this->assertEquals($expectedPackager, $detectedPackager?->getName());
$this->assertSame($expectedPackager, $detectedPackager?->getName());
} else {
$this->assertNull($detectedPackager);
}
Expand Down Expand Up @@ -116,9 +116,9 @@ public function testDetectRuntimeByFilematch(

if ($runtime) {
$this->assertNotNull($detectedRuntime);
$this->assertEquals($runtime, $detectedRuntime?->getName());
$this->assertEquals($commands, $detectedRuntime?->getCommands());
$this->assertEquals($entrypoint, $detectedRuntime?->getEntrypoint());
$this->assertSame($runtime, $detectedRuntime?->getName());
$this->assertSame($commands, $detectedRuntime?->getCommands());
$this->assertSame($entrypoint, $detectedRuntime?->getEntrypoint());
} else {
$this->assertNull($detectedRuntime);
}
Expand Down Expand Up @@ -175,8 +175,8 @@ public function testDetectRuntimeByLanguage(

if ($runtime) {
$this->assertNotNull($detectedRuntime);
$this->assertEquals($runtime, $detectedRuntime?->getName());
$this->assertEquals($commands, $detectedRuntime?->getCommands());
$this->assertSame($runtime, $detectedRuntime?->getName());
$this->assertSame($commands, $detectedRuntime?->getCommands());
} else {
$this->assertNull($detectedRuntime);
}
Expand Down Expand Up @@ -246,8 +246,8 @@ public function testDetectRuntimeByFileExtension(

if ($runtime) {
$this->assertNotNull($detectedRuntime);
$this->assertEquals($runtime, $detectedRuntime?->getName());
$this->assertEquals($commands, $detectedRuntime?->getCommands());
$this->assertSame($runtime, $detectedRuntime?->getName());
$this->assertSame($commands, $detectedRuntime?->getCommands());
} else {
$this->assertNull($detectedRuntime);
}
Expand Down Expand Up @@ -294,10 +294,10 @@ public function testFrameworkDetection(array $files, ?string $framework, ?string

if ($framework) {
$this->assertNotNull($detectedFramework);
$this->assertEquals($framework, $detectedFramework?->getName());
$this->assertEquals($installCommand, $detectedFramework?->getInstallCommand());
$this->assertEquals($buildCommand, $detectedFramework?->getBuildCommand());
$this->assertEquals($outputDirectory, $detectedFramework?->getOutputDirectory());
$this->assertSame($framework, $detectedFramework?->getName());
$this->assertSame($installCommand, $detectedFramework?->getInstallCommand());
$this->assertSame($buildCommand, $detectedFramework?->getBuildCommand());
$this->assertSame($outputDirectory, $detectedFramework?->getOutputDirectory());
} else {
$this->assertNull($detectedFramework);
}
Expand Down Expand Up @@ -342,8 +342,8 @@ public function testRenderingDetection(array $files, string $framework, string $
$detectedRendering = $detector->detect();

$this->assertNotNull($detectedRendering);
$this->assertEquals($rendering, $detectedRendering->getName());
$this->assertEquals($fallbackFile, $detectedRendering->getFallbackFile());
$this->assertSame($rendering, $detectedRendering->getName());
$this->assertSame($fallbackFile, $detectedRendering->getFallbackFile());
}

/**
Expand Down Expand Up @@ -418,10 +418,10 @@ public function testTanStackStartDetectionWithPackages(): void
if (is_null($detectedFramework)) {
throw new \Exception('Framework not detected');
}
$this->assertEquals('tanstack-start', $detectedFramework->getName());
$this->assertEquals('npm install', $detectedFramework->getInstallCommand());
$this->assertEquals('npm run build', $detectedFramework->getBuildCommand());
$this->assertEquals('./.output', $detectedFramework->getOutputDirectory());
$this->assertSame('tanstack-start', $detectedFramework->getName());
$this->assertSame('npm install', $detectedFramework->getInstallCommand());
$this->assertSame('npm run build', $detectedFramework->getBuildCommand());
$this->assertSame('./.output', $detectedFramework->getOutputDirectory());
}

/**
Expand Down Expand Up @@ -450,9 +450,9 @@ public function testTanStackStartDetectionWithDevPackages(): void
throw new \Exception('Framework not detected');
}

$this->assertEquals('tanstack-start', $detectedFramework->getName());
$this->assertEquals('pnpm install', $detectedFramework->getInstallCommand());
$this->assertEquals('pnpm build', $detectedFramework->getBuildCommand());
$this->assertSame('tanstack-start', $detectedFramework->getName());
$this->assertSame('pnpm install', $detectedFramework->getInstallCommand());
$this->assertSame('pnpm build', $detectedFramework->getBuildCommand());
}

/**
Expand Down Expand Up @@ -796,6 +796,6 @@ public function testFrameworkEdgeCases(string $assertion, array $files, string $
throw new \Exception('Framework not detected');
}

$this->assertEquals($framework, $detection->getName(), $assertion);
$this->assertSame($framework, $detection->getName(), $assertion);
}
}