mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Make SiteTree reference conditional
This makes the boilerplate code compatible for testing framework-only sites.
This commit is contained in:
parent
8956b2d4fa
commit
81f292a2b5
@ -197,6 +197,7 @@ class FeatureContext extends SilverStripeContext {
|
||||
$factory->define('Member', $blueprint);
|
||||
|
||||
// Auto-publish pages
|
||||
if (class_exists('SiteTree')) {
|
||||
foreach(\ClassInfo::subclassesFor('SiteTree') as $id => $class) {
|
||||
$blueprint = \Injector::inst()->create('FixtureBlueprint', $class);
|
||||
$blueprint->addCallback('afterCreate', function($obj, $identifier, &$data, &$fixtures) {
|
||||
@ -205,6 +206,7 @@ class FeatureContext extends SilverStripeContext {
|
||||
$factory->define($class, $blueprint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setMinkParameters(array $parameters) {
|
||||
parent::setMinkParameters($parameters);
|
||||
|
Loading…
Reference in New Issue
Block a user