*/
class CaseTypeTest extends \PHPUnit\Framework\Assert {
- public function testPreConditions($cv) {
+ public function testPreConditions($cv): void {
$this->assertFileExists(static::getPath('/xml/case/DuckDance.xml'), 'The shimmy extension must have a Case XML file.');
}
- public function testInstalled($cv) {
+ public function testInstalled($cv): void {
$items = $cv->api4('CaseType', 'get', ['where' => [['name', '=', 'DuckDance']]]);
$this->assertEquals('The mysterious case of the dancing duck', $items[0]['description']);
$this->assertEquals('DuckDance', $items[0]['name']);
$this->assertEquals(TRUE, $actTypes[0]['is_active'], 'ActivityType "Quack" should be auto enabled. It\'s inactive.');
}
- public function testDisabled($cv) {
+ public function testDisabled($cv): void {
$items = $cv->api4('CaseType', 'get', ['where' => [['name', '=', 'DuckDance']]]);
$this->assertEquals('The mysterious case of the dancing duck', $items[0]['description']);
$this->assertEquals('DuckDance', $items[0]['name']);
$this->assertEquals(1, count($items));
}
- public function testUninstalled($cv) {
+ public function testUninstalled($cv): void {
$items = $cv->api4('CaseType', 'get', ['where' => [['name', '=', 'DuckDance']]]);
$this->assertEquals(0, count($items));
const EXAMPLE_NAME = 'ShimThing';
- public function testPreConditions($cv) {
+ public function testPreConditions($cv): void {
$this->assertFileExists(static::getPath('/xml/schema/CRM/Shimmy/ShimThing.xml'), 'The shimmy extension must have *.xml.');
$this->assertFileExists(static::getPath('/xml/schema/CRM/Shimmy/ShimThing.entityType.php'), 'The shimmy extension must have *.entityTYpe.php.');
$this->assertFileExists(static::getPath('/CRM/Shimmy/DAO/ShimThing.php'), 'The shimmy extension must have DAO.');
}
- public function testInstalled($cv) {
+ public function testInstalled($cv): void {
$this->assertEquals(self::EXAMPLE_NAME, $cv->phpCall('CRM_Core_DAO_AllCoreTables::getBriefName', [self::EXAMPLE_DAO]));
$this->assertEquals(self::EXAMPLE_TABLE, $cv->phpCall('CRM_Core_DAO_AllCoreTables::getTableForClass', [self::EXAMPLE_DAO]));
$this->assertEquals(self::EXAMPLE_NAME, $cv->phpCall('CRM_Core_DAO_AllCoreTables::getEntityNameForTable', [self::EXAMPLE_TABLE]));
$this->assertEquals('ShimThing ID', $cv->phpEval('return \CRM_Shimmy_DAO_ShimThing::fields()["id"]["title"];'));
}
- public function testDisabled($cv) {
+ public function testDisabled($cv): void {
$this->assertEquals(NULL, $cv->phpCall('CRM_Core_DAO_AllCoreTables::getBriefName', [self::EXAMPLE_DAO]));
$this->assertEquals(NULL, $cv->phpCall('CRM_Core_DAO_AllCoreTables::getTableForClass', [self::EXAMPLE_DAO]));
$this->assertEquals(NULL, $cv->phpCall('CRM_Core_DAO_AllCoreTables::getEntityNameForTable', [self::EXAMPLE_TABLE]));
}
- public function testUninstalled($cv) {
+ public function testUninstalled($cv): void {
$this->assertEquals(NULL, $cv->phpCall('CRM_Core_DAO_AllCoreTables::getBriefName', [self::EXAMPLE_DAO]));
$this->assertEquals(NULL, $cv->phpCall('CRM_Core_DAO_AllCoreTables::getTableForClass', [self::EXAMPLE_DAO]));
$this->assertEquals(NULL, $cv->phpCall('CRM_Core_DAO_AllCoreTables::getEntityNameForTable', [self::EXAMPLE_TABLE]));
*/
protected $url;
- public function testPreConditions($cv) {
+ public function testPreConditions($cv): void {
$this->assertFileExists(static::getPath('/xml/Menu/shimmy.xml'), 'The shimmy extension must have a Menu XML file.');
}
- public function testInstalled($cv) {
+ public function testInstalled($cv): void {
// The menu item is registered...
$items = $cv->api4('Route', 'get', ['where' => [['path', '=', 'civicrm/shimmy/foobar']]]);
$this->assertEquals('CRM_Shimmy_Page_FooBar', $items[0]['page_callback']);
$this->assertRegExp(';hello world;', $response);
}
- public function testDisabled($cv) {
+ public function testDisabled($cv): void {
$items = $cv->api4('Route', 'get', ['where' => [['path', '=', 'civicrm/shimmy/foobar']]]);
$this->assertEmpty($items);
$this->assertNotRegExp(';HTTP.*200.*;', $http_response_header[0]);
}
- public function testUninstalled($cv) {
+ public function testUninstalled($cv): void {
// Same as disabled.
$this->testDisabled($cv);
}
*/
class ManagedCaseTypeTest extends \PHPUnit\Framework\Assert {
- public function testPreConditions($cv) {
+ public function testPreConditions($cv): void {
$this->assertFileExists(static::getPath('/CRM/BunnyDance.mgd.php'), 'The shimmy extension must have a Case MGD file.');
}
- public function testInstalled($cv) {
+ public function testInstalled($cv): void {
$items = $cv->api4('CaseType', 'get', ['where' => [['name', '=', 'BunnyDance']]]);
$this->assertEquals('The mysterious case of the dancing bunny', $items[0]['description']);
$this->assertEquals('BunnyDance', $items[0]['name']);
// $this->assertEquals(TRUE, $actTypes[0]['is_active'], 'ActivityType "Nibble" should be auto enabled. It\'s inactive.');
}
- public function testDisabled($cv) {
+ public function testDisabled($cv): void {
$items = $cv->api4('CaseType', 'get', ['where' => [['name', '=', 'BunnyDance']]]);
$this->assertEquals('The mysterious case of the dancing bunny', $items[0]['description']);
$this->assertEquals('BunnyDance', $items[0]['name']);
$this->assertEquals(1, count($items));
}
- public function testUninstalled($cv) {
+ public function testUninstalled($cv): void {
$items = $cv->api4('CaseType', 'get', ['where' => [['name', '=', 'BunnyDance']]]);
$this->assertEquals(0, count($items));
*/
class ManagedTest extends \PHPUnit\Framework\Assert {
- public function testPreConditions($cv) {
+ public function testPreConditions($cv): void {
$this->assertFileExists(static::getPath('/CRM/ShimmyGroup.mgd.php'), 'The shimmy extension must have a Menu XML file.');
}
- public function testInstalled($cv) {
+ public function testInstalled($cv): void {
$items = $cv->api4('OptionGroup', 'get', ['where' => [['name', '=', 'shimmy_group']]]);
$this->assertEquals('Shimmy Group', $items[0]['title']);
$this->assertEquals(TRUE, $items[0]['is_active']);
}
- public function testDisabled($cv) {
+ public function testDisabled($cv): void {
$items = $cv->api4('OptionGroup', 'get', ['where' => [['name', '=', 'shimmy_group']]]);
$this->assertEquals('Shimmy Group', $items[0]['title']);
$this->assertEquals(FALSE, $items[0]['is_active']);
}
- public function testUninstalled($cv) {
+ public function testUninstalled($cv): void {
$items = $cv->api4('OptionGroup', 'get', ['where' => [['name', '=', 'shimmy_group']]]);
$this->assertEmpty($items);
}
*/
class ScanClassesTest extends \PHPUnit\Framework\Assert {
- public function testPreConditions($cv) {
+ public function testPreConditions($cv): void {
$this->assertFileExists(static::getPath('/CRM/Shimmy/ShimmyMessage.php'), 'The shimmy extension must have example PHP files.');
}
- public function testInstalled($cv) {
+ public function testInstalled($cv): void {
// Assert that WorkflowMessageInterface's are registered.
$items = $cv->api4('WorkflowMessage', 'get', ['where' => [['name', '=', 'shimmy_message_example']]]);
$this->assertEquals('CRM_Shimmy_ShimmyMessage', $items[0]['class']);
$this->assertEquals($expectHookData, $hookData);
}
- public function testDisabled($cv) {
+ public function testDisabled($cv): void {
// Assert that WorkflowMessageInterface's are removed.
$items = $cv->api4('WorkflowMessage', 'get', ['where' => [['name', '=', 'shimmy_message_example']]]);
$this->assertEmpty($items);
$this->assertEquals([], $hookData);
}
- public function testUninstalled($cv) {
+ public function testUninstalled($cv): void {
// Assert that WorkflowMessageInterface's are removed.
$items = $cv->api4('WorkflowMessage', 'get', ['where' => [['name', '=', 'shimmy_message_example']]]);
$this->assertEmpty($items);
*/
class SettingsTest extends \PHPUnit\Framework\Assert {
- public function testPreConditions($cv) {
+ public function testPreConditions($cv): void {
$this->assertFileExists(static::getPath('/settings/Shimmy.setting.php'), 'The shimmy extension must have a Menu XML file.');
}
- public function testInstalled($cv) {
+ public function testInstalled($cv): void {
// The menu item is registered...
$items = $cv->api4('Setting', 'getFields', ['where' => [['name', '=', 'shimmy_example']], 'loadOptions' => TRUE]);
$this->assertEquals('shimmy_example', $items[0]['name']);
$this->assertEquals('second', $value);
}
- public function testDisabled($cv) {
+ public function testDisabled($cv): void {
$items = $cv->api4('Setting', 'getFields', ['where' => [['name', '=', 'shimmy_example']], 'loadOptions' => TRUE]);
$this->assertEmpty($items);
$this->assertEquals('second', $value);
}
- public function testUninstalled($cv) {
+ public function testUninstalled($cv): void {
$items = $cv->api4('Setting', 'getFields', ['where' => [['name', '=', 'shimmy_example']], 'loadOptions' => TRUE]);
$this->assertEmpty($items);
return dirname(__DIR__, 4) . $suffix;
}
- protected function runMethods(string $method, ...$args) {
+ protected function runMethods(string $method, ...$args): void {
if (empty($this->mixinTests)) {
$this->fail('Cannot run methods. No mixin tests found.');
}