Review main Merged

47393[TASK] Increase test coverage of DatabaseConnection classes

Morton Jonuschat CR +2 V +2 Expert +1479 −208 updated 03/30/16, 20:42

Commit message

Increase the test coverage of the DatabaseConnection class by adding
unit and functional tests for core methods.

Reformat the tests to use short array notation and fix PSR-2 warnings.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Tymoteusz Motylewski +1
  • Verified V +2
    • Christian Kuhn +2
    • Tymoteusz Motylewski +1

Issues 1

Files 4

Review log 12

  1. Morton Jonuschat uploaded patch set 1 03/25/16, 20:55

  2. Wouter Wolters commented on patch set 1 03/26/16, 09:19

    DatabaseConnectionTest.php:50

    protected

    DatabaseConnectionTest.php:69

    protected

    PreparedStatementTest.php:21

    preparedstatement

    PreparedStatementTest.php:50

    protected

    PreparedStatementTest.php:69

    protected

    DatabaseConnectionTest.php:52

    protected
  3. Morton Jonuschat uploaded patch set 2 03/26/16, 09:56

  4. Morton Jonuschat commented on patch set 1 03/26/16, 09:57

    DatabaseConnectionTest.php:50 Reply

    Done

    DatabaseConnectionTest.php:69 Reply

    Done

    PreparedStatementTest.php:21 Reply

    Done

    PreparedStatementTest.php:50 Reply

    Done

    PreparedStatementTest.php:69 Reply

    Done

    DatabaseConnectionTest.php:52 Reply

    Done
  5. Frank Nägler commented on patch set 2 03/29/16, 07:49

    DatabaseConnectionTest.php:246

    should we test also the input: \var\log\syslog.log (single backslashes? maybe also for the other DataProvider
  6. Morton Jonuschat commented on patch set 2 03/29/16, 08:02

    DatabaseConnectionTest.php:246 Reply

    This is a single backslash, the string representation needs to escape the backslash to \\ to make sure it's the literal character, not some other escape sequence. Thats why we always wrote 'TYPO3\\CMS\\Core\\..." before the ::class Syntax
  7. Frank Nägler commented on patch set 2 03/29/16, 08:09

    DatabaseConnectionTest.php:246 Reply

    iirc your only need the double backslash if the string is quoted in double quotes, not in single quotes. e.g.: $string = 'abc\def'; OR $string = "abc\\def"; in this case, single quotes are used, a single backslash.
  8. Morton Jonuschat uploaded patch set 3 03/30/16, 15:50

  9. Morton Jonuschat commented on patch set 2 03/30/16, 15:52

    DatabaseConnectionTest.php:246 Reply

    That usage is actually a fallback due to unsupported escape sequences and results in the same output as correctly escaping a literal backslash. Nevertheless I added a test case for that.
  10. Tymoteusz Motylewski voted on patch set 3 CR +1 V +1 03/30/16, 20:41

  11. Christian Kuhn voted on patch set 3 CR +2 V +2 03/30/16, 20:42

  12. Gerrit merged patch set 3 03/30/16, 20:42