diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bd98e82..75bdd27 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,12 +1,13 @@ - + + + + + lib + + - + test - - - lib - - - \ No newline at end of file + diff --git a/test/Content/Base.php b/test/Content/Base.php index 34ddb43..f0a0e45 100644 --- a/test/Content/Base.php +++ b/test/Content/Base.php @@ -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() @@ -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() diff --git a/test/Content/Sql/Base.php b/test/Content/Sql/Base.php index 17ad48d..942c62d 100644 --- a/test/Content/Sql/Base.php +++ b/test/Content/Sql/Base.php @@ -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']); } } @@ -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); @@ -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(); @@ -201,11 +201,11 @@ public static function tearDownAfterClass() parent::tearDownAfterClass(); } - public function setUp() + public function setUp(): void { if (!self::$db) { $this->markTestSkipped(self::$reason); } } -} \ No newline at end of file +} diff --git a/test/Content/Sql/MysqlTest.php b/test/Content/Sql/MysqlTest.php index 4b393fd..f90d109 100644 --- a/test/Content/Sql/MysqlTest.php +++ b/test/Content/Sql/MysqlTest.php @@ -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'; diff --git a/test/Content/Sql/MysqliTest.php b/test/Content/Sql/MysqliTest.php index bd0c220..edca562 100644 --- a/test/Content/Sql/MysqliTest.php +++ b/test/Content/Sql/MysqliTest.php @@ -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'; diff --git a/test/Content/Sql/Oci8Test.php b/test/Content/Sql/Oci8Test.php index adb03b9..4c7afc7 100644 --- a/test/Content/Sql/Oci8Test.php +++ b/test/Content/Sql/Oci8Test.php @@ -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'; diff --git a/test/Content/Sql/Pdo/MysqlTest.php b/test/Content/Sql/Pdo/MysqlTest.php index 512908c..ed4768e 100644 --- a/test/Content/Sql/Pdo/MysqlTest.php +++ b/test/Content/Sql/Pdo/MysqlTest.php @@ -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())) { diff --git a/test/Content/Sql/Pdo/PgsqlTest.php b/test/Content/Sql/Pdo/PgsqlTest.php index 6909d93..96868e8 100644 --- a/test/Content/Sql/Pdo/PgsqlTest.php +++ b/test/Content/Sql/Pdo/PgsqlTest.php @@ -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())) { diff --git a/test/Content/Sql/Pdo/SqliteTest.php b/test/Content/Sql/Pdo/SqliteTest.php index 05ef0e2..7c0f391 100644 --- a/test/Content/Sql/Pdo/SqliteTest.php +++ b/test/Content/Sql/Pdo/SqliteTest.php @@ -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(); @@ -26,4 +26,4 @@ public static function setUpBeforeClass() self::$reason = 'Sqlite not available'; } } -} \ No newline at end of file +}