You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The available mock implementation for database access that currently lives in src/test in the package rdbms.unittest.mock will be exposed to third party use by moving it tinto src/main and thus including it in the publicly available API.
Rationale
Occurrances of usage have been observed; while it was possible to pick up the package, even though it was a test package, it is no longer possible since the introduction of Composer. Tests could benefit from being able to use mocks.
Functionality
The available classes would be:
rdbms.unittest.mock.MockConnection
rdbms.unittest.mock.MockResultSet
rdbms.unittest.mock.MockDialect
rdbms.unittest.mock.RegisterMockConnection (which is a unittest @action class)
The MockConnection class can be used to simulate rdbms sessions:
It should be noted that using this implementation represents a very low-level way to test something; if there are ways to mock / replace higher level objects in the respective test, that way should be preferred.
The text was updated successfully, but these errors were encountered:
Scope of Change
The available mock implementation for database access that currently lives in
src/test
in the packagerdbms.unittest.mock
will be exposed to third party use by moving it tintosrc/main
and thus including it in the publicly available API.Rationale
Occurrances of usage have been observed; while it was possible to pick up the package, even though it was a test package, it is no longer possible since the introduction of Composer. Tests could benefit from being able to use mocks.
Functionality
The available classes would be:
rdbms.unittest.mock.MockConnection
rdbms.unittest.mock.MockResultSet
rdbms.unittest.mock.MockDialect
rdbms.unittest.mock.RegisterMockConnection
(which is a unittest @action class)The
MockConnection
class can be used to simulate rdbms sessions:This resultset will be delivered as the first row of a query.
Simulate server disconnects:
Make server connect fail:
... and some more.
Security considerations
n/a
Speed impact
n/a
Dependencies
Related documents
The text was updated successfully, but these errors were encountered: