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

Unit tests failure: test_reorder_template_competencies

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: None
    • Component/s: Competencies
    • Labels:

      Description

      this is due to make idnumber unique in competency.

      vendor/bin/phpunit tool_lp_external_testcase admin/tool/lp/tests/externallib_test.php
      Moodle 3.0dev (Build: 20150820), mysqli, 2cfbe9b16bdf1fe078f4a34c4c11cae705f135cc
      PHPUnit 4.7.7 by Sebastian Bergmann and contributors.
       
      .............................E.
       
      Time: 1.55 minutes, Memory: 61.25Mb
       
      There was 1 error:
       
      1) tool_lp_external_testcase::test_reorder_template_competencies
      dml_write_exception: Error writing to database (Duplicate entry '431000-idnumber' for key 'mdlut_toollpcomp_comidn_uix'
      INSERT INTO mdlut_tool_lp_competency (shortname,idnumber,description,descriptionformat,sortorder,visible,timecreated,timemodified,usermodified,competencyframeworkid,parentid,path) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)
      [array (
        0 => 'shortname2',
        1 => 'idnumber',
        2 => 'description',
        3 => 1,
        4 => 1,
        5 => 1,
        6 => 1442328619,
        7 => 1442328619,
        8 => '442000',
        9 => 431000,
        10 => 0,
        11 => '/0/',
      )])
       
      /app/apache2/htdocs/moodlegit/lib/dml/moodle_database.php:446
      /app/apache2/htdocs/moodlegit/lib/dml/mysqli_native_moodle_database.php:1164
      /app/apache2/htdocs/moodlegit/lib/dml/mysqli_native_moodle_database.php:1210
      /app/apache2/htdocs/moodlegit/admin/tool/lp/classes/persistent.php:186
      /app/apache2/htdocs/moodlegit/admin/tool/lp/classes/competency.php:325
      /app/apache2/htdocs/moodlegit/admin/tool/lp/classes/api.php:55
      /app/apache2/htdocs/moodlegit/admin/tool/lp/classes/external.php:888
      /app/apache2/htdocs/moodlegit/admin/tool/lp/tests/externallib_test.php:869
      /app/apache2/htdocs/moodlegit/lib/phpunit/classes/advanced_testcase.php:80
       
      To re-run:
       vendor/bin/phpunit tool_lp_external_testcase admin/tool/lp/tests/externallib_test.php
       
      FAILURES!
      Tests: 31, Assertions: 151, Errors: 1.
      
      

      In the test test_reorder_template_competencies we try to insert 3 competencies with the same idnumber. we have to make idnumber diffrent for the competencies added to pass the test.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gaudreaj Jean-Philippe Gaudreau
                Reporter:
                taboubii Issam Taboubi
                Peer reviewer:
                Frédéric Massart
                Participants:
                Component watchers:
                Damyon Wiese, Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: