/**
* Unitary tests for Shaarli utilities
*/
-class UtilsTest extends PHPUnit_Framework_TestCase
+class UtilsTest extends PHPUnit\Framework\TestCase
{
// Log file
protected static $testLogFile = 'tests.log';
/**
* Test generate location with valid data.
*/
- public function testGenerateLocation() {
+ public function testGenerateLocation()
+ {
$ref = 'http://localhost/?test';
$this->assertEquals($ref, generateLocation($ref, 'localhost'));
$ref = 'http://localhost:8080/?test';
/**
* Test generate location - anti loop.
*/
- public function testGenerateLocationLoop() {
+ public function testGenerateLocationLoop()
+ {
$ref = 'http://localhost/?test';
- $this->assertEquals('?', generateLocation($ref, 'localhost', array('test')));
+ $this->assertEquals('./?', generateLocation($ref, 'localhost', array('test')));
}
/**
* Test generate location - from other domain.
*/
- public function testGenerateLocationOut() {
+ public function testGenerateLocationOut()
+ {
$ref = 'http://somewebsite.com/?test';
- $this->assertEquals('?', generateLocation($ref, 'localhost'));
+ $this->assertEquals('./?', generateLocation($ref, 'localhost'));
}