forked from phpbb-extensions/googleanalytics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
128 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fixes: | ||
- "/phpBB3/phpBB/ext/cube/matomoanalytics/::" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* | ||
* Google Analytics extension for the phpBB Forum Software package. | ||
* | ||
* @copyright (c) 2014, 2022 phpBB Limited <https://www.phpbb.com> | ||
* @license GNU General Public License, version 2 (GPL-2.0) | ||
* | ||
*/ | ||
|
||
namespace cube\matomoanalytics\tests\system; | ||
|
||
class ext_test extends \phpbb_test_case | ||
{ | ||
/** @var \PHPUnit\Framework\MockObject\MockObject|\Symfony\Component\DependencyInjection\ContainerInterface */ | ||
protected $container; | ||
|
||
/** @var \PHPUnit\Framework\MockObject\MockObject|\phpbb\finder */ | ||
protected $extension_finder; | ||
|
||
/** @var \PHPUnit\Framework\MockObject\MockObject|\phpbb\db\migrator */ | ||
protected $migrator; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
// Stub the container | ||
$this->container = $this->getMockBuilder('\Symfony\Component\DependencyInjection\ContainerInterface') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
// Stub the ext finder and disable its constructor | ||
$this->extension_finder = $this->getMockBuilder('\phpbb\finder') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
// Stub the migrator and disable its constructor | ||
$this->migrator = $this->getMockBuilder('\phpbb\db\migrator') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
} | ||
|
||
/** | ||
* Test the extension will be enabled with a compatible version of phpBB | ||
*/ | ||
public function test_enable() | ||
{ | ||
$ext = new \cube\matomoanalytics\ext($this->container, $this->extension_finder, $this->migrator, 'cube/matomoanalytics', ''); | ||
|
||
self::assertTrue($ext->is_enableable()); | ||
} | ||
} |