mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Merge pull request #171 from open-sausages/pulls/recycle-dont-waste
Feature use existing fixture for member with the given id if found
This commit is contained in:
commit
4e36ec793e
@ -526,7 +526,10 @@ class FixtureContext implements Context
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @var Member $member */
|
/** @var Member $member */
|
||||||
|
$member = $this->getFixtureFactory()->get(Member::class, $id);
|
||||||
|
if (!$member) {
|
||||||
$member = $this->getFixtureFactory()->createObject(Member::class, $id);
|
$member = $this->getFixtureFactory()->createObject(Member::class, $id);
|
||||||
|
}
|
||||||
$member->Groups()->add($group);
|
$member->Groups()->add($group);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,7 +560,10 @@ class FixtureContext implements Context
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @var Member $member */
|
/** @var Member $member */
|
||||||
|
$member = $this->getFixtureFactory()->get(Member::class, $id);
|
||||||
|
if (!$member) {
|
||||||
$member = $this->getFixtureFactory()->createObject(Member::class, $id, $fields);
|
$member = $this->getFixtureFactory()->createObject(Member::class, $id, $fields);
|
||||||
|
}
|
||||||
$member->Groups()->add($group);
|
$member->Groups()->add($group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user