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

Clean up extra namespaces used in DocumentationExamplesTest

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.16.0
    • Affects Version/s: None
    • Component/s: Tests

      The original documentation examples all used an "inventory" collection within the database under test. As such, DocumentationExamplesTest::getCollectionName() was overridden to return "inventory" and allow the setUp and tearDown methods to clean up the collection contents after each test case.

      Later examples switched to using different collection and database names, which may no longer be cleaned up. Ideally, we should revise these examples to use the database under test whenever possible. The transaction examples will remain a notable exception, since they intentionally execute operations on different databases.

      At the very least, we should ensure that collection data is cleaned up after each test. This can be done by creating an internal utility method to register namespaces, which will then be dropped during tearDown(). Alternatively, we can cook up something using event monitoring to track all namespaces utilized during a test, which might prove useful elsewhere in the test suite.

            Assignee:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: