public function ContactModuleTest::testOrganizationSuggestions in CRM Core 8.3
Test suggestions.
@covers ::crm_core_contact_theme_suggestions_crm_core_organization
File
- modules/
crm_core_contact/ tests/ src/ Unit/ ContactModuleTest.php, line 56
Class
- ContactModuleTest
- Test the module file.
Namespace
Drupal\Tests\crm_core_contact\UnitCode
public function testOrganizationSuggestions() : void {
$organization = $this
->createMock(Organization::class);
$organization
->method('bundle')
->willReturn('customer');
$organization
->method('id')
->willReturn(1);
$result = crm_core_contact_theme_suggestions_crm_core_organization([
'elements' => [
'#crm_core_organization' => $organization,
'#view_mode' => 'my.test',
],
]);
$this
->assertArrayEquals($result, [
'crm_core_organization__my_test',
'crm_core_organization__customer',
'crm_core_organization__customer__my_test',
'crm_core_organization__1',
'crm_core_organization__1__my_test',
]);
}