return type void is required as of PHPunit 7, breaking test compatibility with PHP < 7.1

This commit is contained in:
El RIDO 2020-10-10 12:22:20 +02:00
parent 6f90df9545
commit 37a620df95
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
15 changed files with 26 additions and 41 deletions

View file

@ -11,7 +11,7 @@ class ConfigurationTest extends TestCase
private $_path;
public function setUp()
public function setUp(): void
{
/* Setup Routine */
Helper::confBackup();
@ -26,7 +26,7 @@ class ConfigurationTest extends TestCase
}
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
Helper::rmDir($this->_path);

View file

@ -423,7 +423,7 @@ class ConfigurationCombinationsTest extends TestCase
private $_path;
public function setUp()
public function setUp(): void
{
/* Setup Routine */
Helper::confBackup();
@ -434,7 +434,7 @@ class ConfigurationCombinationsTest extends TestCase
$this->reset();
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
unlink(CONF);

View file

@ -13,7 +13,7 @@ class ControllerTest extends TestCase
protected $_path;
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
@ -21,7 +21,7 @@ class ControllerTest extends TestCase
$this->reset();
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
unlink(CONF);

View file

@ -16,7 +16,7 @@ class ControllerWithDbTest extends ControllerTest
),
);
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';

View file

@ -17,14 +17,14 @@ class DatabaseTest extends TestCase
'opt' => array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION),
);
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
$this->_model = Database::getInstance($this->_options);
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
if (is_dir($this->_path)) {

View file

@ -11,7 +11,7 @@ class FilesystemTest extends TestCase
private $_invalidPath;
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
@ -25,7 +25,7 @@ class FilesystemTest extends TestCase
}
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
chmod($this->_invalidPath, 0700);

View file

@ -7,7 +7,7 @@ class I18nTest extends TestCase
{
private $_translations = array();
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$this->_translations = json_decode(
@ -16,7 +16,7 @@ class I18nTest extends TestCase
);
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
}

View file

@ -12,7 +12,7 @@ class JsonApiTest extends TestCase
protected $_path;
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
@ -33,7 +33,7 @@ class JsonApiTest extends TestCase
Helper::createIniFile(CONF, $options);
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
unlink(CONF);

View file

@ -19,7 +19,7 @@ class ModelTest extends TestCase
protected $_path;
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
@ -45,7 +45,7 @@ class ModelTest extends TestCase
$_SERVER['REMOTE_ADDR'] = '::1';
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
unlink(CONF);

View file

@ -7,7 +7,7 @@ class PurgeLimiterTest extends TestCase
{
private $_path;
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
@ -17,7 +17,7 @@ class PurgeLimiterTest extends TestCase
PurgeLimiter::setPath($this->_path);
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
Helper::rmDir($this->_path);

View file

@ -13,7 +13,7 @@ class ServerSaltTest extends TestCase
private $_invalidFile;
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
@ -31,7 +31,7 @@ class ServerSaltTest extends TestCase
$this->_invalidFile = $this->_invalidPath . DIRECTORY_SEPARATOR . 'salt.php';
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
chmod($this->_invalidPath, 0700);

View file

@ -7,14 +7,14 @@ class TrafficLimiterTest extends TestCase
{
private $_path;
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'trafficlimit';
TrafficLimiter::setPath($this->_path);
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
Helper::rmDir($this->_path . DIRECTORY_SEPARATOR);

View file

@ -5,16 +5,6 @@ use PrivateBin\Request;
class RequestTest extends TestCase
{
public function setUp()
{
/* Setup Routine */
}
public function tearDown()
{
/* Tear Down Routine */
}
public function reset()
{
$_SERVER = array();

View file

@ -30,7 +30,7 @@ class ViewTest extends TestCase
private $_content = array();
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$page = new View;
@ -92,11 +92,6 @@ class ViewTest extends TestCase
}
}
public function tearDown()
{
/* Tear Down Routine */
}
public function testTemplateRendersCorrectly()
{
foreach ($this->_content as $template => $content) {

View file

@ -10,7 +10,7 @@ class Vizhash16x16Test extends TestCase
private $_path;
public function setUp()
public function setUp(): void
{
/* Setup Routine */
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
@ -21,7 +21,7 @@ class Vizhash16x16Test extends TestCase
ServerSalt::setPath($this->_path);
}
public function tearDown()
public function tearDown(): void
{
/* Tear Down Routine */
chmod($this->_path, 0700);