-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1907340
commit c0aafe9
Showing
4 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,12 @@ Feature: EntityContext | |
| fredbloggs | fredbloggs@example.com | | ||
When I am at "admin/people" | ||
Then I should see "johndoe" | ||
When I click "johndoe" | ||
And I click "Edit" | ||
When I click "Edit" in the "johndoe" row | ||
Then the "mail" field should contain "[email protected]" | ||
When I am at "admin/people" | ||
Then I should see "fredbloggs" | ||
When I click "fredbloggs" | ||
And I click "Edit" | ||
Then the "mail" field should contain "[email protected]" | ||
When I click "Edit" in the "fredbloggs" row | ||
Then the "mail" field should contain "[email protected]" | ||
|
||
Scenario: Test entities have been cleaned up after previous scenario | ||
When I am at "admin/people" | ||
|
@@ -36,8 +34,7 @@ Feature: EntityContext | |
| johndoe | johndoe@example.com | | ||
When I am at "admin/people" | ||
Then I should see "johndoe" | ||
When I click "johndoe" | ||
And I click "Edit" | ||
When I click "Edit" in the "johndoe" row | ||
Then the "mail" field should contain "[email protected]" | ||
|
||
Scenario: Test single bundled entity in "Given a :bundle :entity_type entity" | ||
|
@@ -122,7 +119,9 @@ Feature: EntityContext | |
| name | johndoe | | ||
| mail | johndoe@example.com | | ||
Then I should see "johndoe" in the ".page-title" element | ||
When I click "Edit" | ||
When I am at "admin/people" | ||
Then I should see "johndoe" | ||
When I click "Edit" in the "johndoe" row | ||
Then the "mail" field should contain "[email protected]" | ||
|
||
Scenario: Test bundled entity in "Given I am viewing a :bundle :entity_type entity:" | ||
|
25 changes: 25 additions & 0 deletions
25
src/Drupal/DrupalExtension/Hook/Call/AfterEntityCreate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Drupal\DrupalExtension\Hook\Call; | ||
|
||
use Drupal\DrupalExtension\Hook\Scope\OtherEntityScope; | ||
|
||
/** | ||
* AfterEntityCreate hook class. | ||
*/ | ||
class AfterEntityCreate extends EntityHook { | ||
|
||
/** | ||
* Initializes hook. | ||
*/ | ||
public function __construct($filterString, $callable, $description = null) { | ||
parent::__construct(OtherEntityScope::AFTER, $filterString, $callable, $description); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getName() { | ||
return 'AfterEntityCreate'; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Drupal/DrupalExtension/Hook/Call/BeforeEntityCreate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Drupal\DrupalExtension\Hook\Call; | ||
|
||
use Drupal\DrupalExtension\Hook\Scope\OtherEntityScope; | ||
|
||
/** | ||
* BeforeEntityCreate hook class. | ||
*/ | ||
class BeforeEntityCreate extends EntityHook { | ||
|
||
/** | ||
* Initializes hook. | ||
*/ | ||
public function __construct($filterString, $callable, $description = null) { | ||
parent::__construct(OtherEntityScope::BEFORE, $filterString, $callable, $description); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getName() { | ||
return 'BeforeEntityCreate'; | ||
} | ||
|
||
} |