mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-03 18:26:42 +07:00
46 lines
1007 B
ReStructuredText
46 lines
1007 B
ReStructuredText
MapperTestUtility
|
|
=================
|
|
|
|
|
|
Simple utility class for testing mappers
|
|
|
|
|
|
.. php:namespace:: OCA\AppFramework\Utility
|
|
.. php:class:: MapperTestUtility
|
|
|
|
* **Abstract**
|
|
|
|
|
|
.. php:attr:: $api
|
|
|
|
* **Protected**
|
|
|
|
|
|
|
|
|
|
|
|
.. php:method:: beforeEach()
|
|
|
|
|
|
* **Protected**
|
|
|
|
|
|
Run this function before the actual test to either set or initialize theapi.
|
|
After this the api can be accessed by using $this->api
|
|
|
|
|
|
.. php:method:: setMapperResult($sql, $arguments=array(), $returnRows=array(), $limit=null, $offset=null)
|
|
|
|
:param string $sql: the sql query that you expect to receive
|
|
:param array $arguments: the expected arguments for the prepare querymethod
|
|
:param array $returnRows: the rows that should be returned for the resultof the database query. If not provided, it wont be assumed that fetchRowwill be called on the result
|
|
:param mixed $limit:
|
|
:param mixed $offset:
|
|
|
|
* **Protected**
|
|
|
|
|
|
Create mocks and set expected results for database queries
|
|
|
|
|