laminas/laminas-db

qa: PhpUnit >= 9.0 Call to undefined method assertInternalType

ZVanoZ opened this issue · 1 comments

Bug Report

Q A
Version(s) 2.14.x 2.13.4 2.13.3 2.13.2 2.13.1 2.13.0 2.12.0

After commit #166

Summary

Some unit test use method "self::assertInternalType(...)" for check type of result.
This method is deprecated in PHPUnit 8 and removed in PHPUnit 9.
See and use instead

    assertIsArray()
    assertIsBool()
    assertIsFloat()
    assertIsInt()
    assertIsNumeric()
    assertIsObject()
    assertIsResource()
    assertIsString()
    assertIsScalar()
    assertIsCallable()
    assertIsIterable()
    assertIsNotArray()
    assertIsNotBool()
    assertIsNotFloat()
    assertIsNotInt()
    assertIsNotNumeric()
    assertIsNotObject()
    assertIsNotResource()
    assertIsNotString()
    assertIsNotScalar()
    assertIsNotCallable()
    assertIsNotIterable()

Current behavior

Totally 4 usages in

            test/unit/Adapter/Driver/IbmDb2  (2 usages found)
                ConnectionIntegrationTest.php  (2 usages found)
                    24 self::assertInternalType('string', $connection->getCurrentSchema());
                    52 self::assertInternalType('resource', $connection->getResource());
            test/unit/Adapter/Driver/Oci8  (2 usages found)
                ConnectionIntegrationTest.php  (2 usages found)
                    21 self::assertInternalType('string', $connection->getCurrentSchema());
                    51 self::assertInternalType('resource', $connection->getResource());

Example of test output for TESTS_LAMINAS_DB_ADAPTER_DRIVER_OCI8

Testing started at 11:20 ...
[docker://zvanoz/laminas-db-test-by-docker:php7.4-apache-buster/]:php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=172.18.0.1 /var/www/vendor/phpunit/phpunit/phpunit --configuration /var/www/phpunit.xml --teamcity
PHPUnit 9.5.10 by Sebastian Bergmann and contributors.

Error : Call to undefined method LaminasTest\Db\Adapter\Driver\Oci8\ConnectionIntegrationTest::assertInternalType()
 /var/www/test/unit/Adapter/Driver/Oci8/ConnectionIntegrationTest.php:21

Error : Call to undefined method LaminasTest\Db\Adapter\Driver\Oci8\ConnectionIntegrationTest::assertInternalType()
 /var/www/test/unit/Adapter/Driver/Oci8/ConnectionIntegrationTest.php:51

How to reproduce

Run tests and see result.

Expected behavior

All tests is pass.

Likely because IbmDb2 and Oci8 tests never run in CI :|