Files
piratepoet/tests/DataFactories/Features.php
Amine Ben hammou 43df66d162 Add public keyword to methods
[MAILPOET-2413]
2019-12-26 18:09:45 +03:00

33 lines
656 B
PHP

<?php
namespace MailPoet\Test\DataFactories;
use MailPoet\DI\ContainerWrapper;
use MailPoet\Features\FeatureFlagsRepository;
class Features {
/** @var FeatureFlagsRepository */
private $flags;
public function __construct() {
$this->flags = ContainerWrapper::getInstance(WP_DEBUG)->get(FeatureFlagsRepository::class);
}
public function withFeatureEnabled($name) {
$this->flags->createOrUpdate([
'name' => $name,
'value' => true,
]);
return $this;
}
public function withFeatureDisabled($name) {
$this->flags->createOrUpdate([
'name' => $name,
'value' => false,
]);
return $this;
}
}