--- /dev/null
+<?php
+// This file declares an Angular module which can be autoloaded
+// in CiviCRM. See also:
+// \https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules/n
+return array (
+ 'js' =>
+ array (
+ 0 => 'ang/mockBespoke.js',
+ 1 => 'ang/mockBespoke/*.js',
+ 2 => 'ang/mockBespoke/*/*.js',
+ ),
+ 'css' =>
+ array (
+ 0 => 'ang/mockBespoke.css',
+ ),
+ 'partials' =>
+ array (
+ 0 => 'ang/mockBespoke',
+ ),
+ 'requires' =>
+ array (
+ 0 => 'crmUi',
+ 1 => 'crmUtil',
+ 2 => 'ngRoute',
+ ),
+ 'settings' =>
+ array (
+ ),
+);
// The default mockPage has 1 explicit requirement + 2 automatic requirements.
Civi\Api4\Afform::revert()->addWhere('name', '=', $formName)->execute();
$angModule = Civi::service('angular')->getModule($formName);
- $this->assertEquals(['afCore', 'extraMock', 'mockBareFile', 'mockFoo'], $angModule['requires']);
+ $this->assertEquals(['afCore', 'mockBespoke', 'mockBareFile', 'mockFoo'], $angModule['requires']);
$storedRequires = Civi\Api4\Afform::get()->addWhere('name', '=', $formName)->addSelect('requires')->execute();
- $this->assertEquals(['extraMock'], $storedRequires[0]['requires']);
+ $this->assertEquals(['mockBespoke'], $storedRequires[0]['requires']);
// Knock down to 1 explicit + 1 automatic.
Civi\Api4\Afform::update()
->setValues(['layout' => '<div>The bare file says "<span mock-bare-file/>"</div>'])
->execute();
$angModule = Civi::service('angular')->getModule($formName);
- $this->assertEquals(['afCore', 'extraMock', 'mockBareFile'], $angModule['requires']);
+ $this->assertEquals(['afCore', 'mockBespoke', 'mockBareFile'], $angModule['requires']);
$storedRequires = Civi\Api4\Afform::get()->addWhere('name', '=', $formName)->addSelect('requires')->execute();
- $this->assertEquals(['extraMock'], $storedRequires[0]['requires']);
+ $this->assertEquals(['mockBespoke'], $storedRequires[0]['requires']);
// Remove the last explict and implicit requirements.
Civi\Api4\Afform::update()
Civi\Api4\Afform::revert()->addWhere('name', '=', $formName)->execute();
$angModule = Civi::service('angular')->getModule($formName);
- $this->assertEquals(['afCore', 'extraMock', 'mockBareFile', 'mockFoo'], $angModule['requires']);
+ $this->assertEquals(['afCore', 'mockBespoke', 'mockBareFile', 'mockFoo'], $angModule['requires']);
}
}