-
Notifications
You must be signed in to change notification settings - Fork 2
AbstractImplementation
AbstractImplementation extends DependencyHandler class and is abstract, while class that extend it are therefore singletons as well. It provides set of common database-agnostic features that are required for concrete database implementations. Usage examples
For additional help, look at the tests, additional input scenarios are tested. setUp(array $records = [])
Inserts mock data into the database. Argument points to which collections/rows are to be inserted. Empty array results in all dummy data being inserted. Array of collection names causes all of listed collections to be inserted. Array of collection names pointing arrays of row ids, causes only specified rows to be inserted. If dependencies are defined, order of insertion is generated based on the dependencies, with collection being depended upon being inserted before those depending on them. Additionally any data that listed collections depend upon is also inserted. If no dependencies were defined, insertion is performed based on order in which they were listed.
DataContainer::setUp(['collection' => ['id1', 'id2']]);
DataContainer::setUp(['collection']);
DataContainer::setUp([]);
Deletes mock data from the database. Only listed collections/rows are deleted, regardless of whether dependencies were defined.
DataContainer::tearDown(['collection' => ['id1', 'id2']]);
DataContainer::tearDown(['collection']);
DataContainer::tearDown([]);
Deletes mock data from the database, which was inserted by the setUp method. Any mock data inserted outside of the setUp is unaffected.
DataContainer::cleanUp()