mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-06 16:36:59 +01:00
chore(tests): UT for PluginData repository
Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
@@ -184,6 +184,10 @@ final class PluginData extends BaseRepository implements PluginDataRepository
|
||||
*/
|
||||
public function getByNameBatch(array $names): QueryResult
|
||||
{
|
||||
if (count($names) === 0) {
|
||||
return new QueryResult();
|
||||
}
|
||||
|
||||
$query = $this->queryFactory
|
||||
->newSelect()
|
||||
->from(self::TABLE)
|
||||
|
||||
@@ -213,6 +213,15 @@ class PluginDataTest extends UnitaryTestCase
|
||||
$this->pluginData->getByNameBatch($names);
|
||||
}
|
||||
|
||||
public function testGetByNameBatchWithNoNames()
|
||||
{
|
||||
$this->database
|
||||
->expects(self::never())
|
||||
->method('doSelect');
|
||||
|
||||
$this->pluginData->getByNameBatch([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ConstraintException
|
||||
* @throws QueryException
|
||||
@@ -244,6 +253,19 @@ class PluginDataTest extends UnitaryTestCase
|
||||
$this->pluginData->deleteByNameBatch($names);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ConstraintException
|
||||
* @throws QueryException
|
||||
*/
|
||||
public function testDeleteByNameBatchWithNoNames()
|
||||
{
|
||||
$this->database
|
||||
->expects(self::never())
|
||||
->method('doQuery');
|
||||
|
||||
$this->pluginData->deleteByNameBatch([]);
|
||||
}
|
||||
|
||||
public function testGetByItemId()
|
||||
{
|
||||
$callback = new Callback(
|
||||
|
||||
Reference in New Issue
Block a user