Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make phpunit 9.x working with fixes from the debian repro #3

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<phpunit bootstrap="test/Content/bootstrap.php" colors="true">
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="test/Content/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">lib</directory>
</include>
</coverage>
<testsuites>
<testsuite>
<testsuite name="Horde/Content">
<directory>test</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">lib</directory>
</whitelist>
</filter>
</phpunit>
</phpunit>
6 changes: 4 additions & 2 deletions test/Content/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ protected function _testGetRecentTags()
$this->assertEquals(4, $recent[0]['tag_id']);
$this->assertEquals('personal', $recent[0]['tag_name']);
$date = new Horde_Date($recent[0]['created']);
$this->assertEquals(1230764760, $date->timestamp());
// date --date="2009-01-01 00:06:00 UTC" +%s gives: 1230768360
$this->assertEquals(1230768360, $date->timestamp());
}

protected function _testGetRecentTagsByUser()
Expand All @@ -237,7 +238,8 @@ protected function _testGetRecentObjects()
$this->assertEquals(4, count($recent));
$this->assertEquals(4, $recent[0]['object_id']);
$date = new Horde_Date($recent[0]['created'], 'UTC');
$this->assertEquals(1230764760, $date->timestamp());
// date --date="2009-01-01 00:06:00 UTC" +%s gives: 1230768360
$this->assertEquals(1230768360, $date->timestamp());
}

protected function _testUntag()
Expand Down
12 changes: 6 additions & 6 deletions test/Content/Sql/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public function testCreate()
$this->assertEquals(4, count($objects));
// If these aren't strings, then ids were taken as names.
foreach ($objects as $object) {
$this->assertInternalType('string', $object['object_name']);
$this->assertIsString($object['object_name']);
}

$types = self::$db->select('SELECT * FROM rampage_types');
$this->assertEquals(2, count($types));
foreach ($types as $type) {
$this->assertInternalType('string', $type['type_name']);
$this->assertIsString($type['type_name']);
}
}

Expand Down Expand Up @@ -175,7 +175,7 @@ public function testUntag()
$this->_testUntag();
}

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$injector = new Horde_Injector(new Horde_Injector_TopLevel());
self::$injector->setInstance('Horde_Db_Adapter', self::$db);
Expand All @@ -192,7 +192,7 @@ public static function setUpBeforeClass()
self::$type_mgr = self::$injector->createInstance('Content_Types_Manager');
}

public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
if (self::$migrator) {
self::$migrator->down();
Expand All @@ -201,11 +201,11 @@ public static function tearDownAfterClass()
parent::tearDownAfterClass();
}

public function setUp()
public function setUp(): void
{
if (!self::$db) {
$this->markTestSkipped(self::$reason);
}
}

}
}
2 changes: 1 addition & 1 deletion test/Content/Sql/MysqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
class Content_Sql_MysqlTest extends Content_Test_Sql_Base
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!extension_loaded('mysql')) {
self::$reason = 'No mysql extension';
Expand Down
2 changes: 1 addition & 1 deletion test/Content/Sql/MysqliTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
class Content_Sql_MysqliTest extends Content_Test_Sql_Base
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!extension_loaded('mysqli')) {
self::$reason = 'No mysqli extension';
Expand Down
2 changes: 1 addition & 1 deletion test/Content/Sql/Oci8Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
class Content_Sql_Oci8Test extends Content_Test_Sql_Base
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!extension_loaded('oci8')) {
self::$reason = 'No oci8 extension';
Expand Down
2 changes: 1 addition & 1 deletion test/Content/Sql/Pdo/MysqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Content_Sql_Pdo_MysqlTest extends Content_Test_Sql_Base
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!extension_loaded('pdo') ||
!in_array('mysql', PDO::getAvailableDrivers())) {
Expand Down
2 changes: 1 addition & 1 deletion test/Content/Sql/Pdo/PgsqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Content_Sql_Pdo_PgsqlTest extends Content_Test_Sql_Base
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!extension_loaded('pdo') ||
!in_array('pgsql', PDO::getAvailableDrivers())) {
Expand Down
4 changes: 2 additions & 2 deletions test/Content/Sql/Pdo/SqliteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
class Content_Sql_Pdo_SqliteTest extends Content_Test_Sql_Base
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
$factory_db = new Horde_Test_Factory_Db();

Expand All @@ -26,4 +26,4 @@ public static function setUpBeforeClass()
self::$reason = 'Sqlite not available';
}
}
}
}
Loading