mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
return type void is required as of PHPunit 7, breaking test compatibility with PHP < 7.1
This commit is contained in:
parent
6f90df9545
commit
37a620df95
|
@ -11,7 +11,7 @@ class ConfigurationTest extends TestCase
|
||||||
|
|
||||||
private $_path;
|
private $_path;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
Helper::confBackup();
|
Helper::confBackup();
|
||||||
|
@ -26,7 +26,7 @@ class ConfigurationTest extends TestCase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
/* Tear Down Routine */
|
/* Tear Down Routine */
|
||||||
Helper::rmDir($this->_path);
|
Helper::rmDir($this->_path);
|
||||||
|
|
|
@ -423,7 +423,7 @@ class ConfigurationCombinationsTest extends TestCase
|
||||||
|
|
||||||
private $_path;
|
private $_path;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
Helper::confBackup();
|
Helper::confBackup();
|
||||||
|
@ -434,7 +434,7 @@ class ConfigurationCombinationsTest extends TestCase
|
||||||
$this->reset();
|
$this->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
/* Tear Down Routine */
|
/* Tear Down Routine */
|
||||||
unlink(CONF);
|
unlink(CONF);
|
||||||
|
|
|
@ -13,7 +13,7 @@ class ControllerTest extends TestCase
|
||||||
|
|
||||||
protected $_path;
|
protected $_path;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
||||||
|
@ -21,7 +21,7 @@ class ControllerTest extends TestCase
|
||||||
$this->reset();
|
$this->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
/* Tear Down Routine */
|
/* Tear Down Routine */
|
||||||
unlink(CONF);
|
unlink(CONF);
|
||||||
|
|
|
@ -16,7 +16,7 @@ class ControllerWithDbTest extends ControllerTest
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
||||||
|
|
|
@ -17,14 +17,14 @@ class DatabaseTest extends TestCase
|
||||||
'opt' => array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION),
|
'opt' => array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION),
|
||||||
);
|
);
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
||||||
$this->_model = Database::getInstance($this->_options);
|
$this->_model = Database::getInstance($this->_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
/* Tear Down Routine */
|
/* Tear Down Routine */
|
||||||
if (is_dir($this->_path)) {
|
if (is_dir($this->_path)) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ class FilesystemTest extends TestCase
|
||||||
|
|
||||||
private $_invalidPath;
|
private $_invalidPath;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
$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 */
|
/* Tear Down Routine */
|
||||||
chmod($this->_invalidPath, 0700);
|
chmod($this->_invalidPath, 0700);
|
||||||
|
|
|
@ -7,7 +7,7 @@ class I18nTest extends TestCase
|
||||||
{
|
{
|
||||||
private $_translations = array();
|
private $_translations = array();
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$this->_translations = json_decode(
|
$this->_translations = json_decode(
|
||||||
|
@ -16,7 +16,7 @@ class I18nTest extends TestCase
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
/* Tear Down Routine */
|
/* Tear Down Routine */
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ class JsonApiTest extends TestCase
|
||||||
|
|
||||||
protected $_path;
|
protected $_path;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
||||||
|
@ -33,7 +33,7 @@ class JsonApiTest extends TestCase
|
||||||
Helper::createIniFile(CONF, $options);
|
Helper::createIniFile(CONF, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
/* Tear Down Routine */
|
/* Tear Down Routine */
|
||||||
unlink(CONF);
|
unlink(CONF);
|
||||||
|
|
|
@ -19,7 +19,7 @@ class ModelTest extends TestCase
|
||||||
|
|
||||||
protected $_path;
|
protected $_path;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
||||||
|
@ -45,7 +45,7 @@ class ModelTest extends TestCase
|
||||||
$_SERVER['REMOTE_ADDR'] = '::1';
|
$_SERVER['REMOTE_ADDR'] = '::1';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
/* Tear Down Routine */
|
/* Tear Down Routine */
|
||||||
unlink(CONF);
|
unlink(CONF);
|
||||||
|
|
|
@ -7,7 +7,7 @@ class PurgeLimiterTest extends TestCase
|
||||||
{
|
{
|
||||||
private $_path;
|
private $_path;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
||||||
|
@ -17,7 +17,7 @@ class PurgeLimiterTest extends TestCase
|
||||||
PurgeLimiter::setPath($this->_path);
|
PurgeLimiter::setPath($this->_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
/* Tear Down Routine */
|
/* Tear Down Routine */
|
||||||
Helper::rmDir($this->_path);
|
Helper::rmDir($this->_path);
|
||||||
|
|
|
@ -13,7 +13,7 @@ class ServerSaltTest extends TestCase
|
||||||
|
|
||||||
private $_invalidFile;
|
private $_invalidFile;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
$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';
|
$this->_invalidFile = $this->_invalidPath . DIRECTORY_SEPARATOR . 'salt.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
/* Tear Down Routine */
|
/* Tear Down Routine */
|
||||||
chmod($this->_invalidPath, 0700);
|
chmod($this->_invalidPath, 0700);
|
||||||
|
|
|
@ -7,14 +7,14 @@ class TrafficLimiterTest extends TestCase
|
||||||
{
|
{
|
||||||
private $_path;
|
private $_path;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'trafficlimit';
|
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'trafficlimit';
|
||||||
TrafficLimiter::setPath($this->_path);
|
TrafficLimiter::setPath($this->_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
/* Tear Down Routine */
|
/* Tear Down Routine */
|
||||||
Helper::rmDir($this->_path . DIRECTORY_SEPARATOR);
|
Helper::rmDir($this->_path . DIRECTORY_SEPARATOR);
|
||||||
|
|
|
@ -5,16 +5,6 @@ use PrivateBin\Request;
|
||||||
|
|
||||||
class RequestTest extends TestCase
|
class RequestTest extends TestCase
|
||||||
{
|
{
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
/* Setup Routine */
|
|
||||||
}
|
|
||||||
|
|
||||||
public function tearDown()
|
|
||||||
{
|
|
||||||
/* Tear Down Routine */
|
|
||||||
}
|
|
||||||
|
|
||||||
public function reset()
|
public function reset()
|
||||||
{
|
{
|
||||||
$_SERVER = array();
|
$_SERVER = array();
|
||||||
|
|
|
@ -30,7 +30,7 @@ class ViewTest extends TestCase
|
||||||
|
|
||||||
private $_content = array();
|
private $_content = array();
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$page = new View;
|
$page = new View;
|
||||||
|
@ -92,11 +92,6 @@ class ViewTest extends TestCase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
|
||||||
{
|
|
||||||
/* Tear Down Routine */
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testTemplateRendersCorrectly()
|
public function testTemplateRendersCorrectly()
|
||||||
{
|
{
|
||||||
foreach ($this->_content as $template => $content) {
|
foreach ($this->_content as $template => $content) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ class Vizhash16x16Test extends TestCase
|
||||||
|
|
||||||
private $_path;
|
private $_path;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
/* Setup Routine */
|
/* Setup Routine */
|
||||||
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
|
||||||
|
@ -21,7 +21,7 @@ class Vizhash16x16Test extends TestCase
|
||||||
ServerSalt::setPath($this->_path);
|
ServerSalt::setPath($this->_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
/* Tear Down Routine */
|
/* Tear Down Routine */
|
||||||
chmod($this->_path, 0700);
|
chmod($this->_path, 0700);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user