|
@@ 49-57 (lines=9) @@
|
| 46 |
|
$this->permissionChecker = Injector::inst()->get(AnnotatePermissionChecker::class); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
public function testIsEnabled() |
| 50 |
|
{ |
| 51 |
|
$this->assertTrue($this->permissionChecker->isEnabled()); |
| 52 |
|
|
| 53 |
|
Config::modify()->set(DataObjectAnnotator::class, 'enabled', false); |
| 54 |
|
$this->assertFalse($this->permissionChecker->isEnabled()); |
| 55 |
|
// Set everything back to normal |
| 56 |
|
Config::modify()->set(DataObjectAnnotator::class, 'enabled', true); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
public function testAnnotatePermissionChecker() |
| 60 |
|
{ |
|
@@ 59-65 (lines=7) @@
|
| 56 |
|
Config::modify()->set(DataObjectAnnotator::class, 'enabled', true); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
public function testAnnotatePermissionChecker() |
| 60 |
|
{ |
| 61 |
|
Config::modify()->set(DataObjectAnnotator::class, 'enabled', false); |
| 62 |
|
$this->assertFalse($this->permissionChecker->environmentIsAllowed()); |
| 63 |
|
Config::modify()->set(DataObjectAnnotator::class, 'enabled', true); |
| 64 |
|
$this->assertTrue($this->permissionChecker->environmentIsAllowed()); |
| 65 |
|
} |
| 66 |
|
|
| 67 |
|
/** |
| 68 |
|
* Test is a module name is in the @Config enabled_modules |