mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 22:01:33 +00:00
Update tests and related code
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user