Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9592

Test suite does not run on SQLite

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.7-PL1, 3.1.0-dev
    • Fix Version/s: 3.0.8-RC1
    • Component/s: None
    • Labels:
      None
    • Environment:
      PHP 5.3.1, PDO enabled, SQLite 2 and 3 enabled, PHPUnit 3.4.11.

      Description

      tests/test_framework/phpbb_database_test_case.php does not handle SQLite databases very well. It doesn't open the database correctly, the DSN is wrong.

      Some of the CREATE queries can lead to issues, see: http://bugs.php.net/bug.php?id=51492

      The PDO connection uses sqlite3, phpBB's DBAL only supports sqlite2. The two are not compatible, therefore phpBB cannot open the database.

      PHPUnit does not support sqlite2. I have created a patch to add support and sent a pull request: http://github.com/evil3/phpunit/compare/3.4...sqlite2-mapping

      You can use my fork of PHPUnit to run the tests. Just do:

      cd phpbb3/tests/
      /path/to/evil3/phpunit/phpunit.php dbal/all_tests.php

      1. patched-output.txt
        14 kB
        Oleg [X]
      2. test_config.php
        0.1 kB
        Oleg [X]
      3. unpatched-output.txt
        0.2 kB
        Oleg [X]

        Issue Links

          Activity

          Hide
          naderman Nils Adermann added a comment -

          Isn't that error message pretty much self explanatory. Please update your PHPUnit?

          Show
          naderman Nils Adermann added a comment - Isn't that error message pretty much self explanatory. Please update your PHPUnit?
          Hide
          Oleg Oleg [X] (Inactive) added a comment -

          If you're referring to the one error message in unpatched output, it's not an error and it is displayed because development versions of phpunit have a version of @package_version@, which I'm guessing compares less than 3.3.0.

          If you're referring to the many error messages in patched output, the phpunit I used was a clone of Igor's tree which ought to be as up to date as one could get.

          Show
          Oleg Oleg [X] (Inactive) added a comment - If you're referring to the one error message in unpatched output, it's not an error and it is displayed because development versions of phpunit have a version of @package_version@, which I'm guessing compares less than 3.3.0. If you're referring to the many error messages in patched output, the phpunit I used was a clone of Igor's tree which ought to be as up to date as one could get.
          Hide
          igorw Igor Wiedler [X] (Inactive) added a comment -

          Rebased onto develop-olympus and squashed. Two test cases are still failing because an empty IN() is valid under SQLite. Maybe just remove those test cases?

          If we're to go with that, you can use this branch: http://github.com/evil3/phpbb3/compare/ticket/9592-remove-tests

          Show
          igorw Igor Wiedler [X] (Inactive) added a comment - Rebased onto develop-olympus and squashed. Two test cases are still failing because an empty IN() is valid under SQLite. Maybe just remove those test cases? If we're to go with that, you can use this branch: http://github.com/evil3/phpbb3/compare/ticket/9592-remove-tests
          Hide
          bantu Andreas Fischer added a comment -

          Works for me. I have updated to PHPUnit 3.4.15 using "pear upgrade".
          The branch is running fine on PostgreSQL and SQLite for me.

          Show
          bantu Andreas Fischer added a comment - Works for me. I have updated to PHPUnit 3.4.15 using "pear upgrade". The branch is running fine on PostgreSQL and SQLite for me.
          Hide
          bantu Andreas Fischer added a comment -

          @nn-
          The sqlite filename is specified using the $dbhost variable, you're using $dbname.
          You also have to specify a filename, ':memory:' does not work.

          Show
          bantu Andreas Fischer added a comment - @nn- The sqlite filename is specified using the $dbhost variable, you're using $dbname. You also have to specify a filename, ':memory:' does not work.

            People

            • Assignee:
              igorw Igor Wiedler [X] (Inactive)
              Reporter:
              igorw Igor Wiedler [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development