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

Refactor quizaccess_seb unit tests

XMLWordPrintable

      Some issues with unit tests in quizaccess_seb were identified as part of  MDL-68654

      https://tracker.moodle.org/browse/MDL-68654?focusedCommentId=796785&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-796785

      1) Forcing $this->resetAfterTest() and generator->create_course() in quizaccess_seb_testcase->setUp(). That code should be the nearest possible to the unit test. Right now, every unit test that we want to write will force, always, a database reset and the creation of a course, when we may be, perfectly, covering some method not requiring any of them.

      2) Creating a parent quizaccess_seb_testcase itself, without any unit test (test_xxx) method... is prone to errors. If tomorrow anybody wants to create a unit test and adds it to that class... those tests will be executed X times, child classes will run it again and again. That should be a helper/fixtures or anything else, not a testcase.

      3) BTW, also, we discovered yesterday... that the path for all those tests are really wrong (tests/phpunit). "phpunit" is not valid at all. Not sure if this has been reported in another issue, I just remember it because yesterday we were all surprised that we missed that detail.

       

            dmitriim Dmitrii Metelkin
            dmitriim Dmitrii Metelkin
            Tim Hunt Tim Hunt
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 51 minutes
                51m

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