Skip to content

Commit

Permalink
Merge pull request #12 from interactive-solutions/additional-function…
Browse files Browse the repository at this point in the history
…ality

Addition functionality
  • Loading branch information
noggan authored Apr 5, 2017
2 parents b4d9cf6 + 9555d07 commit 99672c3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Context/EntityFixtureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,31 @@ public function anExistingWithParentAndValues($type, $parentType, $parentId, Tab
*
* @param $type
* @param $alias
*
* @return void
*/
public function anExistingOnAlias($type, $alias)
{
$this->anExistingOnAliasWithValues($type, $alias, new TableNode([]));
}

/**
* @Given an existing :type on alias :alias as :childAlias
*/
public function anExistingOnAliasAs($type, $alias, $childAlias)
{
$this->anExistingOnAliasAsWithValues($type, $alias, $childAlias, new TableNode([]));
}

/**
* @Given an existing :type on alias :alias as :childAlias with values:
*/
public function anExistingOnAliasAsWithValues($type, $alias, $childAlias, TableNode $values)
{
$childEntity = $this->anExistingOnAliasWithValues($type, $alias, $values);
$this->addEntityToAlias($childEntity, $childAlias);
}

/**
* Add an entity with a association to a parent entity with alias
*
Expand All @@ -475,6 +494,8 @@ public function anExistingOnAlias($type, $alias)
* @param string $type
* @param $alias
* @param TableNode $values
*
* @return object
*/
public function anExistingOnAliasWithValues($type, $alias, TableNode $values)
{
Expand Down Expand Up @@ -503,6 +524,8 @@ public function anExistingOnAliasWithValues($type, $alias, TableNode $values)

$this->entityManager->persist($targetEntity);
$this->entityManager->flush();

return $targetEntity;
}

/**
Expand Down

0 comments on commit 99672c3

Please sign in to comment.