Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
composer version bumb phpunit8.5
Browse files Browse the repository at this point in the history
execute composer:
composer update phpunit/* sebastian/* doctrine/* myclabs/* phpspec/*

Change-Id: I1b63c0f10a8314e80b92597c16c6b12c23243b58
Reviewed-on: http://gerrit.tine20.com/customers/18229
Tested-by: Jenkins CI (http://ci.tine20.com/) <tine20-jenkins@metaways.de>
Reviewed-by: Paul Mehrer <p.mehrer@metaways.de>
  • Loading branch information
paulmhh committed Oct 20, 2020
1 parent 8e83383 commit c5932e2
Show file tree
Hide file tree
Showing 383 changed files with 2,696 additions and 2,372 deletions.
10 changes: 5 additions & 5 deletions tests/js_client/SessionTestSuite.php
Expand Up @@ -12,13 +12,13 @@
* test suite with shared Selenium RC Session
*
*/
class SessionTestSuite extends PHPUnit_Framework_TestSuite
class SessionTestSuite extends \PHPUnit\Framework\TestSuite
{
/* moved to testHelper as it seems like setUp is called in any suite,
* whereas tearDown only in the outer one (as expected)
* we should run our setup code only once per session
protected function setUp()
{
protected function setUp(): void
{
$connection = new SessionTestCase();
$connection->setBrowser('*firefox');
$connection->setBrowserUrl('http://localhost/tt/tine20/');
Expand All @@ -32,8 +32,8 @@ protected function setUp()
}
*/

protected function tearDown()
{
protected function tearDown(): void
{
SessionTestCase::destroySession();
}
}
4 changes: 2 additions & 2 deletions tests/setup/AllTests.php
Expand Up @@ -31,11 +31,11 @@ public static function main()
/**
* suite
*
* @return PHPUnit_Framework_TestSuite
* @return \PHPUnit\Framework\TestSuite
*/
public static function suite()
{
$suite = new PHPUnit_Framework_TestSuite('Tine 2.0 Setup All Tests');
$suite = new \PHPUnit\Framework\TestSuite('Tine 2.0 Setup All Tests');
$suite->addTest(Setup_AllTests::suite());

return $suite;
Expand Down
4 changes: 2 additions & 2 deletions tests/setup/BaseTest.php
Expand Up @@ -9,14 +9,14 @@
*/


class BaseTest extends PHPUnit_Framework_TestCase
class BaseTest extends \PHPUnit\Framework\TestCase
{

public static function main()
{
require_once 'PHPUnit/TextUI/TestRunner.php';

$suite = new PHPUnit_Framework_TestSuite(get_class(self));
$suite = new \PHPUnit\Framework\TestSuite(get_class(self));
$result = PHPUnit_TextUI_TestRunner::run($suite);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/setup/Setup/AllTests.php
Expand Up @@ -25,7 +25,7 @@ public static function main ()

public static function suite ()
{
$suite = new PHPUnit_Framework_TestSuite('Tine 2.0 Setup All Tests');
$suite = new \PHPUnit\Framework\TestSuite('Tine 2.0 Setup All Tests');
$suite->addTestSuite('Setup_CoreTest');
$suite->addTestSuite('Setup_ControllerTest');
$suite->addTestSuite('Setup_JsonTest');
Expand Down
22 changes: 11 additions & 11 deletions tests/setup/Setup/Backend/AbstractTest.php
Expand Up @@ -58,14 +58,14 @@ abstract class Setup_Backend_AbstractTest extends BaseTest
</table>';


protected function setUp()
{
protected function setUp(): void
{
$this->_backend = Setup_Backend_Factory::factory();
$this->_createTestTable();
}

protected function tearDown()
{
protected function tearDown(): void
{
foreach ($this->_tableNames as $tableName) {
try {
$this->_backend->dropTable($tableName);
Expand Down Expand Up @@ -284,7 +284,7 @@ public function testStringToFieldStatement_001()

$field = Setup_Backend_Schema_Field_Factory::factory('Xml', $string);

$this->setExpectedException('Zend_Db_Statement_Exception'); //Column "id" already exists - expecting Exception'
$this->expectException('Zend_Db_Statement_Exception'); //Column "id" already exists - expecting Exception'
$this->_backend->addCol($this->_table->name, $field);

}
Expand Down Expand Up @@ -343,7 +343,7 @@ public function testStringToFieldStatement_002()
</field>";

$field = Setup_Backend_Schema_Field_Factory::factory('Xml', $string);
$this->setExpectedException('Zend_Db_Statement_Exception'); //1075: There may only be one autoincrement column - expecting Exception'
$this->expectException('Zend_Db_Statement_Exception'); //1075: There may only be one autoincrement column - expecting Exception'
$this->_backend->addCol($this->_table->name, $field);
}

Expand Down Expand Up @@ -392,7 +392,7 @@ public function testStringToFieldStatement_004()

$db = Tinebase_Core::getDb();
$db->insert(SQL_TABLE_PREFIX . $this->_table->name, array('name' => 'test', 'test' => 'enabled'));
$this->setExpectedException('Zend_Db_Statement_Exception'); //invalid enum value -> expect exception
$this->expectException('Zend_Db_Statement_Exception'); //invalid enum value -> expect exception
$db->insert(SQL_TABLE_PREFIX . $this->_table->name, array('name' => 'test', 'test' => 'deleted'));
}

Expand Down Expand Up @@ -615,7 +615,7 @@ public function testStringToFieldStatement_020()
$result = $db->fetchCol($db->select()->from($tableName, 'price'));
$this->assertEquals(round($value), $result[1], 'Test if too many scale digits get rounded');

$this->setExpectedException('Zend_Db_Statement_Exception'); //too many digits (maxim 4 + 2 precision)
$this->expectException('Zend_Db_Statement_Exception'); //too many digits (maxim 4 + 2 precision)
$value = 99999;
$db->insert($tableName, array('name' => 'test3', 'price' => $value));
}
Expand Down Expand Up @@ -746,7 +746,7 @@ public function testStringToIndexStatement_001()

$index = Setup_Backend_Schema_Index_Factory::factory('Xml', $string);

$this->setExpectedException('Zend_Db_Statement_Exception'); //ORA-02260: there can only be one primary key - expecting Exception
$this->expectException('Zend_Db_Statement_Exception'); //ORA-02260: there can only be one primary key - expecting Exception
$this->_backend->addIndex($this->_table->name, $index);
}

Expand All @@ -765,7 +765,7 @@ public function testStringToIndexStatement_002()

$index = Setup_Backend_Schema_Index_Factory::factory('Xml', $string);

$this->setExpectedException('Zend_Db_Statement_Exception'); //field application_id does not exist
$this->expectException('Zend_Db_Statement_Exception'); //field application_id does not exist
$this->_backend->addIndex($this->_table->name, $index);
}

Expand Down Expand Up @@ -812,7 +812,7 @@ public function testStringToIndexStatement_003()
$db->insert($tableName, array('name' => 'test2', 'group_id' => 1, 'account_id' => 2));
$db->insert($tableName, array('name' => 'test3', 'group_id' => 2, 'account_id' => 1));

$this->setExpectedException('Zend_Db_Statement_Exception'); //unique constraint violation
$this->expectException('Zend_Db_Statement_Exception'); //unique constraint violation
$db->insert($tableName, array('name' => 'test4', 'group_id' => 1, 'account_id' => 1));
}

Expand Down
2 changes: 1 addition & 1 deletion tests/setup/Setup/Backend/AllTests.php
Expand Up @@ -22,7 +22,7 @@ public static function main ()

public static function suite ()
{
$suite = new PHPUnit_Framework_TestSuite('Tine 2.0 Setup All Backend Tests');
$suite = new \PHPUnit\Framework\TestSuite('Tine 2.0 Setup All Backend Tests');

$backendAdapter = Tinebase_Core::getConfig()->database->adapter;
if ($backendAdapter === 'pdo_mysql') {
Expand Down
2 changes: 1 addition & 1 deletion tests/setup/Setup/Backend/MysqlTest.php
Expand Up @@ -92,7 +92,7 @@ public function testStringToIndexStatement_004()
$index = Setup_Backend_Schema_Index_Factory::factory('Xml', $string);
$this->assertEquals($statement, $this->_backend->getIndexDeclarations($index));

$this->setExpectedException('Zend_Db_Statement_Exception', '42000'); //42000: group_id and account_id fields missing - expecting Exception
$this->expectException('Zend_Db_Statement_Exception'); $this->expectExceptionMessageMatches('/42000/'); //42000: group_id and account_id fields missing - expecting Exception
$this->_backend->addIndex($this->_table->name, $index);
}

Expand Down
6 changes: 3 additions & 3 deletions tests/setup/Setup/Backend/OracleTest.php
Expand Up @@ -90,7 +90,7 @@ public function testAddColWithPositionParameter()
</field>";

$field = Setup_Backend_Schema_Field_Factory::factory('Xml', $string);
$this->setExpectedException('Setup_Backend_Exception_NotImplemented');
$this->expectException('Setup_Backend_Exception_NotImplemented');

$this->_backend->addCol($this->_table->name, $field, 1); //Cannot use 3rd parameter $_position in Oracle
}
Expand All @@ -107,7 +107,7 @@ public function testStringToFieldStatement_002()

$field = Setup_Backend_Schema_Field_Factory::factory('Xml', $string);

$this->setExpectedException('Setup_Backend_Exception_NotImplemented');
$this->expectException('Setup_Backend_Exception_NotImplemented');
$this->_backend->addCol($this->_table->name, $field);
}

Expand Down Expand Up @@ -299,7 +299,7 @@ public function testLongTableName()
</table>';
$table = Setup_Backend_Schema_Table_Factory::factory('Xml', $tableXml);
$this->_tableNames[] = $table->name;
$this->setExpectedException('Zend_Db_Statement_Exception', '972'); //oracle identifiers cannot be longer than 30 characters
$this->expectException('Zend_Db_Statement_Exception'); $this->expectExceptionMessageMatches('/972/'); //oracle identifiers cannot be longer than 30 characters
$this->_backend->createTable($table);
}

Expand Down
8 changes: 4 additions & 4 deletions tests/setup/Setup/Backend/PgsqlTest.php
Expand Up @@ -16,16 +16,16 @@
/**
* Test class for Tinebase_User
*/
class Setup_Backend_PgsqlTest extends PHPUnit_Framework_TestCase
class Setup_Backend_PgsqlTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Setup_Backend_Pgsql
* @access protected
*/
protected $_backend;

protected function setUp()
{
protected function setUp(): void
{
$this->_backend = Setup_Backend_Factory::factory();
}

Expand All @@ -42,4 +42,4 @@ public function testStringToFieldStatement()

$this->assertEquals(' "account_id" integer', $this->_backend->getFieldDeclarations($field));
}
}
}
2 changes: 1 addition & 1 deletion tests/setup/Setup/Backend/Schema/AllTests.php
Expand Up @@ -22,7 +22,7 @@ public static function main ()

public static function suite ()
{
$suite = new PHPUnit_Framework_TestSuite('Tine 2.0 Setup All Backend Tests');
$suite = new \PHPUnit\Framework\TestSuite('Tine 2.0 Setup All Backend Tests');
$suite->addTestSuite('Setup_Backend_Schema_TableTest');
$suite->addTestSuite('Setup_Backend_Schema_FieldTest');
$suite->addTestSuite('Setup_Backend_Schema_IndexTest');
Expand Down
2 changes: 1 addition & 1 deletion tests/setup/Setup/Backend/Schema/FieldTest.php
Expand Up @@ -28,7 +28,7 @@ public function testIsValid()
$field->setName(str_pad('A', 24, 'a'));
$this->assertFalse($field->isValid(), 'Test if a too long field name is invalid');

$this->setExpectedException('Setup_Exception_InvalidSchema');
$this->expectException('Setup_Exception_InvalidSchema');
$field->isValid(true); //Test if the parameter throwException works as expected
}

Expand Down
2 changes: 1 addition & 1 deletion tests/setup/Setup/Backend/Schema/IndexTest.php
Expand Up @@ -49,7 +49,7 @@ public function testIsValid()

$this->assertFalse($index->isValid(), 'Test if a too long field name is invalid');

$this->setExpectedException('Setup_Exception_InvalidSchema');
$this->expectException('Setup_Exception_InvalidSchema');
$index->isValid(true); //Test if the parameter throwException works as expected
}

Expand Down
2 changes: 1 addition & 1 deletion tests/setup/Setup/Backend/Schema/TableTest.php
Expand Up @@ -18,7 +18,7 @@ public function testIsValid()
$table->setName(str_pad('A', 24, 'a'));
$this->assertFalse($table->isValid(), 'Test if a too long field name is invalid');

$this->setExpectedException('Setup_Exception_InvalidSchema');
$this->expectException('Setup_Exception_InvalidSchema');
$table->isValid(true); //Test if the parameter throwException works as expected
}

Expand Down
14 changes: 7 additions & 7 deletions tests/setup/Setup/CliTest.php
Expand Up @@ -27,14 +27,14 @@ class Setup_CliTest extends TestCase
*
* @access protected
*/
protected function setUp()
{
protected function setUp(): void
{
$this->_cli = new Setup_Frontend_Cli();
parent::setUp();
}

protected function tearDown()
{
protected function tearDown(): void
{
parent::tearDown();

// reset old configs
Expand All @@ -50,7 +50,7 @@ public function testSetConfig()
{
$this->_oldConfigs[Tinebase_Config::ALLOWEDJSONORIGINS] = Tinebase_Config::getInstance()->get(Tinebase_Config::ALLOWEDJSONORIGINS);
$output = $this->_cliHelper('setconfig', array('--setconfig','--','configkey=allowedJsonOrigins', 'configvalue='.'["foo","bar"]'));
$this->assertContains('OK - Updated configuration option allowedJsonOrigins for application Tinebase', $output);
$this->assertStringContainsString('OK - Updated configuration option allowedJsonOrigins for application Tinebase', $output);
$result = Tinebase_Config_Abstract::factory('Tinebase')->get('allowedJsonOrigins');
$this->assertEquals("foo", $result[0]);
$this->assertEquals("bar", $result[1]);
Expand All @@ -67,7 +67,7 @@ public function testSetBoolConfig()
$values = array(1, "true");
foreach ($values as $configValue) {
$output = $this->_cliHelper('setconfig', array('--setconfig', '--', 'configkey=' . $config, 'configvalue=' . $configValue));
$this->assertContains('OK - Updated configuration option ' . $config . ' for application Tinebase', $output);
$this->assertStringContainsString('OK - Updated configuration option ' . $config . ' for application Tinebase', $output);
$result = Tinebase_Config_Abstract::factory('Tinebase')->get($config);
$this->assertTrue($result);
}
Expand All @@ -93,7 +93,7 @@ public function testCompare()
$this->testSetConfig();
$result = $this->_cliHelper('compare', array('--compare','--','otherdb='
. Tinebase_Config::getInstance()->get('database')->dbname));
$this->assertContains("Array
$this->assertStringContainsString("Array
(
)", $result);
}
Expand Down
10 changes: 5 additions & 5 deletions tests/setup/Setup/ControllerTest.php
Expand Up @@ -17,7 +17,7 @@
/**
* Test class for Tinebase_Group
*/
class Setup_ControllerTest extends PHPUnit_Framework_TestCase
class Setup_ControllerTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Setup_Controller
Expand All @@ -30,8 +30,8 @@ class Setup_ControllerTest extends PHPUnit_Framework_TestCase
*
* @access protected
*/
protected function setUp()
{
protected function setUp(): void
{
$this->_uit = Setup_ControllerMock::getInstance();

$setupUser = Setup_Update_Abstract::getSetupFromConfigOrCreateOnTheFly();
Expand Down Expand Up @@ -59,8 +59,8 @@ protected function setUp()
*
* @access protected
*/
protected function tearDown()
{
protected function tearDown(): void
{
$testCredentials = Setup_TestServer::getInstance()->getTestCredentials();
$this->_installAllApplications(array(
'defaultAdminGroupName' => 'Administrators',
Expand Down
4 changes: 2 additions & 2 deletions tests/setup/Setup/CoreTest.php
Expand Up @@ -19,7 +19,7 @@
/**
* Test class for Tinebase_Group
*/
class Setup_CoreTest extends PHPUnit_Framework_TestCase
class Setup_CoreTest extends \PHPUnit\Framework\TestCase
{

/**
Expand All @@ -30,7 +30,7 @@ class Setup_CoreTest extends PHPUnit_Framework_TestCase
*/
public static function main()
{
$suite = new PHPUnit_Framework_TestSuite('Tine 2.0 Setup Controller Tests');
$suite = new \PHPUnit\Framework\TestSuite('Tine 2.0 Setup Controller Tests');
PHPUnit_TextUI_TestRunner::run($suite);
}

Expand Down
12 changes: 6 additions & 6 deletions tests/setup/Setup/JsonTest.php
Expand Up @@ -17,7 +17,7 @@
/**
* Test class for Tinebase_Group
*/
class Setup_JsonTest extends PHPUnit_Framework_TestCase
class Setup_JsonTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Setup_Frontend_Json
Expand All @@ -42,7 +42,7 @@ class Setup_JsonTest extends PHPUnit_Framework_TestCase
*/
public static function main()
{
$suite = new PHPUnit_Framework_TestSuite('Tine 2.0 Setup Json Tests');
$suite = new \PHPUnit\Framework\TestSuite('Tine 2.0 Setup Json Tests');
PHPUnit_TextUI_TestRunner::run($suite);
}

Expand All @@ -52,8 +52,8 @@ public static function main()
*
* @access protected
*/
protected function setUp()
{
protected function setUp(): void
{
$this->_json = new Setup_Frontend_Json();
$this->_originalAuthenticationData = $this->_json->loadAuthenticationData();
}
Expand All @@ -64,8 +64,8 @@ protected function setUp()
*
* @access protected
*/
protected function tearDown()
{
protected function tearDown(): void
{
$this->_installAllApps();
}

Expand Down

0 comments on commit c5932e2

Please sign in to comment.