Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-459

Support better failure descriptions in DocumentsMatchConstraint

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Labels:
      None

      Description

      DocumentsMatchConstraint currently makes it difficult to figure out where the comparison failure occurred when checking embedded documents. A few things can be done to improve things:

      • Using $this->exporter to stringify the expected document
      • Throwing a ComparisonFailure instead of a RuntimeException would allow for seeing a diff of the compared documents
      • Using additionalFailureDescription allows for adding more information as to what failed.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: