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

ErrorSuppressionTest: refactor to use data providers + bug fixes for the tests #3335

Commits on May 8, 2021

  1. ErrorSuppressionTest::testSuppressError(): refactor to data provider

    * Maintains the exact same existing tests, now using a data provider.
        The data provider uses keys which allows for much more descriptive output when using the PHPUnit `--testdox` option, as well as for easier debugging if/when a test would fail.
    * Orders the tests in logical groups in the data provider.
    * Switches out `assertEquals()` (loose type comparison) for `assertSame()` (strict type comparison).
    * Caches the `$config` and `$ruleset` for the test via static local variables to prevent the test run from becoming slower due to the change to the data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    7364463 View commit details
    Browse the repository at this point in the history
  2. ErrorSuppressionTest::testSuppressSomeErrors(): refactor to data prov…

    …ider
    
    * Maintains the exact same existing tests, now using a data provider.
        The data provider uses keys which allows for much more descriptive output when using the PHPUnit `--testdox` option, as well as for easier debugging if/when a test would fail.
    * Orders the tests in logical groups in the data provider.
    * Switches out `assertEquals()` (loose type comparison) for `assertSame()` (strict type comparison).
    * Caches the `$config` and `$ruleset` for the test via static local variables to prevent the test run from becoming slower due to the change to the data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    0d31521 View commit details
    Browse the repository at this point in the history
  3. ErrorSuppressionTest::testSuppressWarning(): refactor to data provider

    * Maintains the exact same existing tests, now using a data provider.
        The data provider uses keys which allows for much more descriptive output when using the PHPUnit `--testdox` option, as well as for easier debugging if/when a test would fail.
    * Orders the tests in logical groups in the data provider.
    * Switches out `assertEquals()` (loose type comparison) for `assertSame()` (strict type comparison).
    * Caches the `$config` and `$ruleset` for the test via static local variables to prevent the test run from becoming slower due to the change to the data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    58e8734 View commit details
    Browse the repository at this point in the history
  4. ErrorSuppressionTest: move one test case out of testSuppressLine()

    ... as it uses a different code pattern, so doesn't fit with the other tests for the (upcoming) data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    8f2ec28 View commit details
    Browse the repository at this point in the history
  5. ErrorSuppressionTest::testSuppressLine(): refactor to data provider

    * Maintains the exact same existing tests, now using a data provider.
        The data provider uses keys which allows for much more descriptive output when using the PHPUnit `--testdox` option, as well as for easier debugging if/when a test would fail.
    * Orders the tests in logical groups in the data provider.
    * Switches out `assertEquals()` (loose type comparison) for `assertSame()` (strict type comparison).
    * Caches the `$config` and `$ruleset` for the test via static local variables to prevent the test run from becoming slower due to the change to the data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    d465698 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c14b49d View commit details
    Browse the repository at this point in the history
  7. ErrorSuppressionTest::testNestedSuppressLine(): refactor to data prov…

    …ider
    
    * Maintains the exact same existing tests, now using a data provider.
        The data provider uses keys which allows for much more descriptive output when using the PHPUnit `--testdox` option, as well as for easier debugging if/when a test would fail.
    * Orders the tests in logical groups in the data provider.
    * Switches out `assertEquals()` (loose type comparison) for `assertSame()` (strict type comparison).
    * Caches the `$config` and `$ruleset` for the test via static local variables to prevent the test run from becoming slower due to the change to the data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    f9dfb9b View commit details
    Browse the repository at this point in the history
  8. ErrorSuppressionTest: fix bug in testSuppressScope()

    As the "no suppression" test would yield no errors, the test wasn't actually testing anything as there were no errors to suppress.
    
    Fixed now by using a different sniff to test against, which does yield an error on the line being suppressed by the rest of the tests.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    32ecc58 View commit details
    Browse the repository at this point in the history
  9. ErrorSuppressionTest::testSuppressScope(): refactor to data provider

    * Maintains the exact same existing tests, now using a data provider.
        The data provider uses keys which allows for much more descriptive output when using the PHPUnit `--testdox` option, as well as for easier debugging if/when a test would fail.
    * Orders the tests in logical groups in the data provider.
    * Switches out `assertEquals()` (loose type comparison) for `assertSame()` (strict type comparison).
    * Caches the `$config` and `$ruleset` for the test via static local variables to prevent the test run from becoming slower due to the change to the data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    9165a9a View commit details
    Browse the repository at this point in the history
  10. ErrorSuppressionTest::testSuppressFile(): fix bugs in test

    This fixes two bugs in two test cases for the `testSuppressFile()` method:
    1. The code snippet as was, contained a parse error (missing semi-colon after class instantiation).
    2. The code snippet did not contain anything which would trigger the warning the test is looking for in the first place, so these two tests would always pass.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    e67a5df View commit details
    Browse the repository at this point in the history
  11. ErrorSuppressionTest::testSuppressFile(): refactor to data provider

    * Maintains the exact same existing tests, now using a data provider.
        The data provider uses keys which allows for much more descriptive output when using the PHPUnit `--testdox` option, as well as for easier debugging if/when a test would fail.
    * Orders the tests in logical groups in the data provider.
    * Switches out `assertEquals()` (loose type comparison) for `assertSame()` (strict type comparison).
    * Caches the `$config` and `$ruleset` for the test via static local variables to prevent the test run from becoming slower due to the change to the data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    99d83b1 View commit details
    Browse the repository at this point in the history
  12. ErrorSuppressionTest::testDisableSelected(): refactor to data provider

    **Note**: the "docblock" tests have changed to use the same basic code sample as the other tests. In practice this means that instead of having 0 errors and 0/1 warnings, they will now yield 1 error and 0/1 warnings. Functionally these tests still test the same principle.
    
    * Maintains the exact same existing tests, now using a data provider.
        The data provider uses keys which allows for much more descriptive output when using the PHPUnit `--testdox` option, as well as for easier debugging if/when a test would fail.
    * Orders the tests in logical groups in the data provider.
    * Switches out `assertEquals()` (loose type comparison) for `assertSame()` (strict type comparison).
    * Caches the `$config` and `$ruleset` for the test via static local variables to prevent the test run from becoming slower due to the change to the data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    b1e74cc View commit details
    Browse the repository at this point in the history
  13. ErrorSuppressionTest::testDisableSelected(): add some more tests

    By the looks of it, combining disabling at different levels and disabling error codes wasn't covered in the tests.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    888479a View commit details
    Browse the repository at this point in the history
  14. ErrorSuppressionTest::testEnableSelected(): refactor to data provider

    * Maintains the exact same existing tests, now using a data provider.
        The data provider uses keys which allows for much more descriptive output when using the PHPUnit `--testdox` option, as well as for easier debugging if/when a test would fail.
    * Orders the tests in logical groups in the data provider.
    * Switches out `assertEquals()` (loose type comparison) for `assertSame()` (strict type comparison).
    * Caches the `$config` and `$ruleset` for the test via static local variables to prevent the test run from becoming slower due to the change to the data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    68c1867 View commit details
    Browse the repository at this point in the history
  15. ErrorSuppressionTest::testIgnoreSelected(): refactor to data provider

    * Maintains the exact same existing tests, now using a data provider.
        The data provider uses keys which allows for much more descriptive output when using the PHPUnit `--testdox` option, as well as for easier debugging if/when a test would fail.
    * Orders the tests in logical groups in the data provider.
    * Switches out `assertEquals()` (loose type comparison) for `assertSame()` (strict type comparison).
    * Caches the `$config` and `$ruleset` for the test via static local variables to prevent the test run from becoming slower due to the change to the data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    46f0100 View commit details
    Browse the repository at this point in the history
  16. ErrorSuppressionTest::testCommenting(): refactor to data provider

    * Maintains the exact same existing tests, now using a data provider.
        The data provider uses keys which allows for much more descriptive output when using the PHPUnit `--testdox` option, as well as for easier debugging if/when a test would fail.
    * Orders the tests in logical groups in the data provider.
    * Switches out `assertEquals()` (loose type comparison) for `assertSame()` (strict type comparison).
    * Caches the `$config` and `$ruleset` for the test via static local variables to prevent the test run from becoming slower due to the change to the data provider.
    jrfnl committed May 8, 2021
    Configuration menu
    Copy the full SHA
    41c1601 View commit details
    Browse the repository at this point in the history