/**
* Unitary tests for Shaarli utilities
*/
-class UtilsTest extends PHPUnit\Framework\TestCase
+class UtilsTest extends \Shaarli\TestCase
{
// Log file
protected static $testLogFile = 'tests.log';
/**
* Assign reference data
*/
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
self::$defaultTimeZone = date_default_timezone_get();
// Timezone without DST for test consistency
/**
* Reset the timezone
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
date_default_timezone_set(self::$defaultTimeZone);
}
/**
* Resets test data before each test
*/
- protected function setUp()
+ protected function setUp(): void
{
if (file_exists(self::$testLogFile)) {
unlink(self::$testLogFile);
public function testGenerateLocationLoop()
{
$ref = 'http://localhost/?test';
- $this->assertEquals('?', generateLocation($ref, 'localhost', array('test')));
+ $this->assertEquals('./?', generateLocation($ref, 'localhost', array('test')));
}
/**
public function testGenerateLocationOut()
{
$ref = 'http://somewebsite.com/?test';
- $this->assertEquals('?', generateLocation($ref, 'localhost'));
+ $this->assertEquals('./?', generateLocation($ref, 'localhost'));
}