2019-04-21 16:30:02 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* PlaylistArchiveStreamTest class.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Alltube\Test;
|
|
|
|
|
|
|
|
use Alltube\Config;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
|
|
/**
|
2019-04-22 14:05:58 +00:00
|
|
|
* Abstract class used by every test.
|
2019-04-21 16:30:02 +00:00
|
|
|
*/
|
|
|
|
abstract class BaseTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
2019-04-21 17:14:23 +00:00
|
|
|
* Get the config file used in tests.
|
|
|
|
*
|
|
|
|
* @return string Path to file
|
2019-04-21 16:30:02 +00:00
|
|
|
*/
|
2019-04-21 17:14:23 +00:00
|
|
|
protected function getConfigFile()
|
2019-04-21 16:30:02 +00:00
|
|
|
{
|
|
|
|
if (PHP_OS == 'WINNT') {
|
|
|
|
$configFile = 'config_test_windows.yml';
|
|
|
|
} else {
|
|
|
|
$configFile = 'config_test.yml';
|
|
|
|
}
|
|
|
|
|
2019-04-21 17:14:23 +00:00
|
|
|
return __DIR__.'/../config/'.$configFile;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prepare tests.
|
|
|
|
*/
|
|
|
|
protected function setUp()
|
|
|
|
{
|
|
|
|
Config::setFile($this->getConfigFile());
|
2019-04-21 16:30:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy properties after test.
|
|
|
|
*/
|
|
|
|
protected function tearDown()
|
|
|
|
{
|
|
|
|
Config::destroyInstance();
|
|
|
|
}
|
|
|
|
}
|