Skip to content

Commit

Permalink
Use new options in the license manager for the EE features
Browse files Browse the repository at this point in the history
  • Loading branch information
jvillafanez committed Jan 18, 2021
1 parent 43ae89e commit fc28a71
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
3 changes: 1 addition & 2 deletions templates/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
p($l->t('Enable Secure View (requires Enterprise edition)'));
print_unescaped('</em>');
} else {
//FIXME: in 10.6 we wont need to warn about requring enterprise edition, but just disable checkbox
p($l->t('Enable Secure View (requires Enterprise edition)'));
p($l->t('Enable Secure View'));
}?></label>
<div id="enable-share-attributes-defaults" style="padding-left: 28px;" class="indent <?php if ($_['secure_view_option'] !== 'true') {
p('hidden');
Expand Down
27 changes: 21 additions & 6 deletions tests/unit/AppConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,26 @@ public function testOpenInNewtabDefault() {
$this->assertEquals(true, $enterpriseEdition);
}

public function testSecureViewDisabled() {
// TODO: This is currently aligned with the changes at the moment.
// we've decided to release secure_view as community in this version
// until a new core release fixes the problem with the license.
$enterpriseEdition = $this->appConfig->enterpriseFeaturesEnabled();
$this->assertEquals(true, $enterpriseEdition);
public function enterpriseFeaturesEnabledProvider() {
return [
[true, true],
[false, false],
];
}

/**
* @dataProvider enterpriseFeaturesEnabledProvider
*/
public function testEnterpriseFeaturesEnabled($licenseCheckReturn, $expectedResult) {
$options = [
'startGracePeriod' => false,
'disableApp' => false,
];
$this->licenseManager->expects($this->once())
->method('checkLicenseFor')
->with('richdocuments', $options)
->willReturn($licenseCheckReturn);

$this->assertSame($expectedResult, $this->appConfig->enterpriseFeaturesEnabled());
}
}

0 comments on commit fc28a71

Please sign in to comment.