namespace OCA\Files;
+use OCP\IDBConnection;
use OCP\L10N\IFactory;
use OCP\Activity\IExtension;
use OCP\Activity\IManager;
/** @var \OCP\Activity\IManager */
protected $activityManager;
+ /** @var \OCP\IDBConnection */
+ protected $connection;
+
/** @var \OCP\IConfig */
protected $config;
* @param IURLGenerator $URLGenerator
* @param IManager $activityManager
* @param ActivityHelper $helper
+ * @param IDBConnection $connection
* @param IConfig $config
*/
- public function __construct(IFactory $languageFactory, IURLGenerator $URLGenerator, IManager $activityManager, ActivityHelper $helper, IConfig $config) {
+ public function __construct(IFactory $languageFactory, IURLGenerator $URLGenerator, IManager $activityManager, ActivityHelper $helper, IDBConnection $connection, IConfig $config) {
$this->languageFactory = $languageFactory;
$this->URLGenerator = $URLGenerator;
$this->l = $this->getL10N();
$this->activityManager = $activityManager;
$this->helper = $helper;
+ $this->connection = $connection;
$this->config = $config;
}
}
foreach ($favorites['folders'] as $favorite) {
$fileQueryList[] = '`file` LIKE ?';
- $parameters[] = \OC::$server->getDatabaseConnection()->escapeLikeParameter($favorite) . '/%';
+ $parameters[] = $this->connection->escapeLikeParameter($favorite) . '/%';
}
return [
use OCA\Files\Activity;
use Test\TestCase;
+/**
+ * Class ActivityTest
+ *
+ * @group DB
+ * @package OCA\Files\Tests
+ */
class ActivityTest extends TestCase {
/** @var \OC\ActivityManager */
$this->getMockBuilder('OCP\IURLGenerator')->disableOriginalConstructor()->getMock(),
$this->activityManager,
$this->activityHelper,
+ \OC::$server->getDatabaseConnection(),
$this->config
);