Update tests and related code

This commit is contained in:
DariusIII
2026-02-13 14:11:33 +01:00
parent 94edb32da5
commit d91426b0f8
3 changed files with 17 additions and 2 deletions
+6 -1
View File
@@ -51,7 +51,12 @@ class NzbService
public function __construct()
{
$nzbSplitLevel = (int) Settings::settingValue('nzbsplitlevel');
try {
$nzbSplitLevel = (int) Settings::settingValue('nzbsplitlevel');
} catch (\Illuminate\Database\QueryException $e) {
// Table doesn't exist yet (e.g., during migrations or tests)
$nzbSplitLevel = 1;
}
$this->nzbSplitLevel = $nzbSplitLevel;
$this->siteNzbPath = config('nntmux_settings.path_to_nzbs');
if (! Str::endsWith($this->siteNzbPath, '/')) {
@@ -74,7 +74,12 @@ abstract class AbstractTvProvider extends BaseVideoProvider
{
parent::__construct();
$this->catWhere = 'categories_id BETWEEN '.Category::TV_ROOT.' AND '.Category::TV_OTHER.' AND categories_id != '.Category::TV_ANIME;
$this->tvqty = Settings::settingValue('maxrageprocessed') !== '' ? (int) Settings::settingValue('maxrageprocessed') : 75;
try {
$this->tvqty = Settings::settingValue('maxrageprocessed') !== '' ? (int) Settings::settingValue('maxrageprocessed') : 75;
} catch (\Illuminate\Database\QueryException $e) {
// Table doesn't exist yet (e.g., during migrations or tests)
$this->tvqty = 75;
}
$this->imgSavePath = storage_path('covers/tvshows/');
$this->siteColumns = ['tvdb', 'trakt', 'tvrage', 'tvmaze', 'imdb', 'tmdb']; // @phpstan-ignore assign.propertyType
}
+5
View File
@@ -26,6 +26,11 @@ final class InstallTest extends TestCase
{
public function test_full_install(): void
{
// Skip in CI when using SQLite in-memory database
if (config('database.default') === 'testing' || config('database.default') === 'sqlite') {
$this->markTestSkipped('Full install test requires a real database connection, not SQLite in-memory.');
}
$this->artisan('migrate:fresh', ['--seed' => true])
->assertExitCode(0);