2017-04-25 17:36:59 -04:00
|
|
|
<?php
|
|
|
|
|
/**
|
2024-05-10 09:09:14 -04:00
|
|
|
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2017-04-25 17:36:59 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace Test\App\AppStore\Bundles;
|
|
|
|
|
|
|
|
|
|
use OC\App\AppStore\Bundles\Bundle;
|
|
|
|
|
use OCP\IL10N;
|
|
|
|
|
use Test\TestCase;
|
|
|
|
|
|
|
|
|
|
abstract class BundleBase extends TestCase {
|
2020-08-11 15:32:18 -04:00
|
|
|
/** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
|
2017-04-25 17:36:59 -04:00
|
|
|
protected $l10n;
|
|
|
|
|
/** @var Bundle */
|
|
|
|
|
protected $bundle;
|
|
|
|
|
/** @var string */
|
|
|
|
|
protected $bundleIdentifier;
|
|
|
|
|
/** @var string */
|
|
|
|
|
protected $bundleName;
|
|
|
|
|
/** @var array */
|
|
|
|
|
protected $bundleAppIds;
|
|
|
|
|
|
2019-11-27 09:27:18 -05:00
|
|
|
protected function setUp(): void {
|
2017-04-25 17:36:59 -04:00
|
|
|
parent::setUp();
|
|
|
|
|
$this->l10n = $this->createMock(IL10N::class);
|
|
|
|
|
$this->l10n->method('t')
|
2020-03-25 17:21:27 -04:00
|
|
|
->willReturnCallback(function ($text, $parameters = []) {
|
2017-04-25 17:36:59 -04:00
|
|
|
return vsprintf($text, $parameters);
|
2020-03-25 17:21:27 -04:00
|
|
|
});
|
2017-04-25 17:36:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testGetIdentifier() {
|
|
|
|
|
$this->assertSame($this->bundleIdentifier, $this->bundle->getIdentifier());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testGetName() {
|
|
|
|
|
$this->assertSame($this->bundleName, $this->bundle->getName());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testGetAppIdentifiers() {
|
|
|
|
|
$this->assertSame($this->bundleAppIds, $this->bundle->getAppIdentifiers());
|
|
|
|
|
}
|
|
|
|
|
}
|