Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-24756

TestUtils#deleteSpace(EntityReference) does nothing and TestUtils#getURLToDeleteSpace returns a wrong URL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Trivial
    • None
    • 18.4.4
    • Test Framework
    • None
    • Unknown

    Description

      That's because of a parameter mismatch when calling getURL() that unfortunately happens to type check.

      At line 1017 in getUrlToDeleteSpace:

      When getURL is called, "WebHome" is passed to the action parameter and the query string is passed to the fragment parameter:

          /**
           * @param space the reference of the space to delete
           * @return the URL that can be used to delete the specified pace
           * @since 14.1RC1
           */
          public String getURLToDeleteSpace(EntityReference space)
          {
              return getURL(space, "WebHome", "deletespace", "confirm=1&async=false&affectChidlren=on");
          }
      

      Because this calls getURL(EntityReference reference, String action, String queryString, String fragment) instead of what was intended, getURL(EntityReference reference, String action, String queryString).

      Additionally, affectChidlren looks wrong, it should probably read affectChildren:

      The fix probably consists in removing "WebHome" and fixing affectChildren, like this:

          /**
           * @param space the reference of the space to delete
           * @return the URL that can be used to delete the specified pace
           * @since 14.1RC1
           */
          public String getURLToDeleteSpace(EntityReference space)
          {
              return getURL(space, "deletespace", "confirm=1&async=false&affectChildren=on");
          }
      

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            rjakse Raphaël Jakse
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: