Files
laravel-video-extractor/tests/TestCase.php
2026-07-16 21:56:58 +03:00

56 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace Apoloz\VideoExtractor\Tests;
use Apoloz\VideoExtractor\VideoExtractorServiceProvider;
use Orchestra\Testbench\TestCase as OrchestraTestCase;
abstract class TestCase extends OrchestraTestCase
{
/**
* @param \Illuminate\Foundation\Application $app
* @return array<class-string>
*/
protected function getPackageProviders($app): array
{
return [VideoExtractorServiceProvider::class];
}
/**
* @param \Illuminate\Foundation\Application $app
* @return array<string, class-string>
*/
protected function getPackageAliases($app): array
{
return [
'Video' => \Apoloz\VideoExtractor\Facades\Video::class,
];
}
/**
* Disable caching by default in tests for deterministic behaviour.
*
* @param \Illuminate\Foundation\Application $app
*/
protected function getEnvironmentSetUp($app): void
{
$app['config']->set('video-extractor.cache.enabled', false);
}
/**
* Read a fixture file from tests/fixtures.
*/
protected function fixture(string $path): string
{
$full = __DIR__ . '/fixtures/' . ltrim($path, '/');
if (!is_file($full)) {
self::fail("Fixture not found: {$full}");
}
return (string) file_get_contents($full);
}
}