Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-73405

PHP 8.0: Fix all problems detected by phplint

    XMLWordPrintable

Details

    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • Hide

      Steps (for 311_STABLE and master)

      1. Ensure that you're using PHP 8.0 to run these tests
      2. Init phpunit (php admin/tool/phpunit/cli/init.php).
      3. Run vendor/bin/phpunit --testsuite core_phpunit_testsuite --testdox
      4. Verify that the test ends ok (OK (XX tests, YYY assertions) ) (numbers don't matter).
      5. Verify that the output includes a group of tests with heading: phpunit_dataset_test (core\phpunit_dataset_test)
      6. Verify that the group includes a good number of tests, all them passing ok.
      7. Run vendor/bin/phpunit lib/phpunit/tests/phpunit_dataset_test.php
      8. Verify that the test ends ok OK (44 tests, 135 assertions)
      9. Run php -l lib/phpunit/tests/phpunit_dataset_test.php
      10. Verify that "No syntax errors detected..." is the result.
      11. Run php -l lib/horde/framework/Horde/Imap/Client/Exception/ServerResponse.php
      12. Verify that "No syntax errors detected..." is the result.

      Steps (for 310_STABLE)

      1. Ensure that you're using PHP 7.4 to run these tests
      2. Repeat all the steps (but number 1) executed for "311_STABLE and master" above.
      Show
      Steps (for 311_STABLE and master) Ensure that you're using PHP 8.0 to run these tests Init phpunit ( php admin/tool/phpunit/cli/init.php ). Run vendor/bin/phpunit --testsuite core_phpunit_testsuite --testdox Verify that the test ends ok ( OK (XX tests, YYY assertions) ) (numbers don't matter). Verify that the output includes a group of tests with heading: phpunit_dataset_test (core\phpunit_dataset_test) Verify that the group includes a good number of tests, all them passing ok. Run vendor/bin/phpunit lib/phpunit/tests/phpunit_dataset_test.php Verify that the test ends ok OK (44 tests, 135 assertions) Run php -l lib/phpunit/tests/phpunit_dataset_test.php Verify that "No syntax errors detected..." is the result. Run php -l lib/horde/framework/Horde/Imap/Client/Exception/ServerResponse.php Verify that "No syntax errors detected..." is the result. Steps (for 310_STABLE) Ensure that you're using PHP 7.4 to run these tests Repeat all the steps (but number 1) executed for "311_STABLE and master" above.

    Description

      Just run:

      composer require --dev php-parallel-lint/php-parallel-lint && \
      vendor/bin/parallel-lint --show-deprecated .
      

      And fix all the problems detected by the linter

      Attachments

        1. master_testdox1.png
          master_testdox1.png
          153 kB
        2. master_testdox2.png
          master_testdox2.png
          196 kB
        3. MDL-73405_error.png
          MDL-73405_error.png
          51 kB
        4. MDL-73405_master_2.png
          MDL-73405_master_2.png
          70 kB
        5. MDL-73405_v310.webm
          810 kB
        6. MDL-73405_v311_2.png
          MDL-73405_v311_2.png
          70 kB

        Activity

          People

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Andrew Lyons Andrew Lyons
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 37 minutes
                1h 37m

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.