Skip to content

Commit

Permalink
Issue: dpi#152: added automated test for EventType::getIdentityTypeEn…
Browse files Browse the repository at this point in the history
…tityFormMode().
  • Loading branch information
MegaChriz committed Oct 2, 2017
1 parent 35f7400 commit a5c77ce
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/src/Kernel/RngEventTypeEntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,41 @@
*/
class RngEventTypeEntityTest extends RngKernelTestBase {

/**
* Tests getting a single identity type form mode.
*
* @covers ::getIdentityTypeEntityFormMode
*/
public function testGetIdentityTypeEntityFormMode() {
$people_type = [
'entity_type' => $this->randomMachineName(),
'bundle' => $this->randomMachineName(),
'entity_form_mode' => $this->randomMachineName(),
];
$values['people_types'][] = $people_type;
$event_type = $this->createEventTypeBase($values);

$result = $event_type->getIdentityTypeEntityFormMode($people_type['entity_type'], $people_type['bundle']);
$this->assertEquals($people_type['entity_form_mode'], $result);
}

/**
* Tests getting a single identity type form mode when no defaults set.
*
* @covers ::getIdentityTypeEntityFormMode
*/
public function testGetIdentityTypeEntityFormModeNoDefaults() {
$people_type = [
'entity_type' => $this->randomMachineName(),
'bundle' => $this->randomMachineName(),
];
$values['people_types'][] = $people_type;
$event_type = $this->createEventTypeBase($values);

$result = $event_type->getIdentityTypeEntityFormMode($people_type['entity_type'], $people_type['bundle']);
$this->assertEquals('default', $result);
}

/**
* Test getting all identity type form modes.
*
Expand Down

0 comments on commit a5c77ce

Please sign in to comment.