mirror of
https://github.com/friendica/friendica
synced 2025-05-01 15:04:24 +02:00
Test enhancements
This commit is contained in:
parent
70f9d3c596
commit
83ead5ec48
12 changed files with 154 additions and 71 deletions
|
@ -49,4 +49,24 @@ trait DBAMockTrait
|
|||
->times($times)
|
||||
->andReturn($return);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mocking DBA::fetchFirst()
|
||||
*
|
||||
* @param string $arg The argument of fetchFirst
|
||||
* @param bool $return True, if the DB is connected, otherwise false
|
||||
* @param null|int $times How often the method will get used
|
||||
*/
|
||||
public function mockFetchFirst($arg, $return = true, $times = null)
|
||||
{
|
||||
if (!isset($this->dbaMock)) {
|
||||
$this->dbaMock = \Mockery::mock('alias:Friendica\Database\DBA');
|
||||
}
|
||||
|
||||
$this->dbaMock
|
||||
->shouldReceive('fetchFirst')
|
||||
->with($arg)
|
||||
->times($times)
|
||||
->andReturn($return);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue