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

Use DocumentsMatchConstraint for TestCase::assertMatchesDocument

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Tests
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      PHPLIB-410 introduced a MongoDB\Tests\SpecTests\DocumentsMatchConstraint class, which is used by the spec test runners. This should be suitable for the assertMatchesDocument() method in our base test class, MongoDB\Tests\TestCase.

      When implementing this, note the TODO itsems in DocumentsMatchConstraint regarding sortKeys and optimizing document comparisons by comparing extended JSON strings.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: