•  
      request #15124 Failures of the PHP unit tests suite due to an incorrect casing of the \UserXMLExporter class
    Infos
    #15124
    Thomas Gerbet (tgerbet)
    2020-07-17 09:10
    2020-07-16 18:12
    16391
    Details
    Failures of the PHP unit tests suite due to an incorrect casing of the \UserXMLExporter class
    The tests in the \Tracker_FormElement_Field_List_Bind_UgroupsTest generate mocks based on the \UserXMLExporter class however they use an incorrect case.
    As a result the class is not loaded (Composer autoloader is case sensitive) and the class end up being replaced by the mock framework. The other test classes using \UserXMLExporter might fail if they are executed after this one since they do not have access to the real class anymore, PHP is not case sensitive with the class names so the autoloading is not triggered again. This can leads to failure of the unit test suite looking like this:

    1) Tracker\Creation\JiraImporter\Import\Artifact\ArtifactsXMLExporterTest::testItExportsArtifacts
    Error: Call to undefined method UserXmlExporter::build()
    /tuleap/plugins/tracker/tests/unit/Tracker/Creation/JiraImporter/Import/Artifact/ArtifactsXMLExporterTest.php:128

    2) Tracker\Creation\JiraImporter\Import\Artifact\ArtifactsXMLExporterTest::testItExportsArtifactsPaginated
    Error: Call to undefined method UserXmlExporter::build()
    /tuleap/plugins/tracker/tests/unit/Tracker/Creation/JiraImporter/Import/Artifact/ArtifactsXMLExporterTest.php:128

    3) Tuleap\Tracker\Artifact\Tracker_ArtifactTest::testItExportsTheArtifactToXML
    Error: Call to undefined method UserXmlExporter::exportUserByUserId()
    /tuleap/plugins/tracker/include/Tracker/XML/Exporter/ChangesetXMLExporter.class.php:67
    /tuleap/plugins/tracker/include/Tracker/XML/Exporter/ArtifactXMLExporter.php:70
    /tuleap/plugins/tracker/include/Tracker/Artifact/Tracker_Artifact.class.php:2073
    /tuleap/plugins/tracker/tests/unit/Tracker/Artifact/Tracker_ArtifactTest.php:865
    [...]
    Dev tools
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Thomas Gerbet (tgerbet)
    Closed
    2020-07-17
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Thomas Gerbet (tgerbet)2020-07-16 18:15
    Patch under review: gerrit #19549.

    • Summary
      -Failures of the PHP unit tests suite due to incorrect casing of the \UserXMLExporter class 
      +Failures of the PHP unit tests suite due to an incorrect casing of the \UserXMLExporter class 
    • Original Submission
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    • Status changed from Under implementation to Under review