Merge pull request #23101 from MegaphoneJon/core-1836-js
[civicrm-core.git] / tests / phpunit / api / v4 / Entity / ExtensionTest.php
1 <?php
2
3 /*
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
6 | |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
11 */
12
13 /**
14 *
15 * @package CRM
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 */
18
19
20 namespace api\v4\Entity;
21
22 use api\v4\UnitTestCase;
23 use Civi\Api4\Extension;
24
25 /**
26 * @group headless
27 */
28 class ExtensionTest extends UnitTestCase {
29
30 public function testGet() {
31 $moduleTest = Extension::get(FALSE)
32 ->addWhere('key', '=', 'test.extension.manager.moduletest')
33 ->execute()->single();
34 $this->assertEquals('test_extension_manager_moduletest', $moduleTest['label']);
35 $this->assertEquals(['mock'], $moduleTest['tags']);
36
37 $moduleTest = Extension::get(FALSE)
38 ->addWhere('file', '=', 'moduletest')
39 ->execute()->single();
40 $this->assertEquals('test_extension_manager_moduletest', $moduleTest['label']);
41 $this->assertEquals(['mock'], $moduleTest['tags']);
42 }
43
44 }