Skip to content

Commit

Permalink
Fix shortcut registration.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivopetkov committed Dec 3, 2021
1 parent 655f8f7 commit 5465300
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"ivopetkov/html5-dom-document-php": "2.*"
},
"require-dev": {
"bearframework/addon-tests": "1.*"
"bearcms/addon-tests": "1.*"
},
"autoload": {
"files": [
Expand Down
10 changes: 5 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
->add('BearCMS\Audits', 'classes/Audits.php')
->add('BearCMS\Audits\Internal\Utilities', 'classes/Audits/Internal/Utilities.php');

$app->shortcuts
->add('audits', function () {
return new Audits();
});

$app->bearCMS->addons
->register('bearcms/audits-addon', function (\BearCMS\Addons\Addon $addon) use ($app) {
$addon->initialize = function (array $options = []) use ($app) {

$app->shortcuts
->add('audits', function () {
return new Audits();
});

\BearCMS\Internal\Config::$appSpecificServerData['g9zmd3al'] = 1;
if (isset($options['maxPagesCount'])) {
\BearCMS\Internal\Config::$appSpecificServerData['akz3ajr3'] = (int) $options['maxPagesCount'];
Expand Down
11 changes: 1 addition & 10 deletions tests/AuditsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,9 @@
/**
* @runTestsInSeparateProcesses
*/
class AuditsTest extends BearFramework\AddonTests\PHPUnitTestCase
class AuditsTest extends BearCMS\AddonTests\PHPUnitTestCase
{

// protected function initializeApp(bool $setLogger = true, bool $setDataDriver = true, bool $setCacheDriver = true, bool $addAddon = true): \BearFramework\App
// {
// $app = parent::initializeApp($setLogger, $setDataDriver, $setCacheDriver, false);
// $app->addons->add('bearcms/bearframework-addon');
// $app->bearCMS->initialize([]);
// $app->bearCMS->addons->add('bearcms/audits-addon');
// return $app;
// }

/**
*
*/
Expand Down

0 comments on commit 5465300

Please sign in to comment.