-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an option to disable Piwik tracking
- Loading branch information
Showing
5 changed files
with
65 additions
and
1 deletion.
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
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,8 @@ | ||
--TEST-- | ||
Calling "piwik" function without parameters when the extension is disabled | ||
--TEMPLATE-- | ||
{{ piwik() }} | ||
--DATA-- | ||
return array(); | ||
--EXPECT-- | ||
Twig_Error: Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("No Piwik host was configured or given to generate the tracker code") in "index.twig" at line 2 in "EmptyFunctionCall.test". |
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,7 @@ | ||
--TEST-- | ||
Calling "piwik" function when the extension is disabled | ||
--TEMPLATE-- | ||
{{ piwik('foo', 123) }} | ||
--DATA-- | ||
return array(); | ||
--EXPECT-- |
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,21 @@ | ||
<?php | ||
|
||
namespace Tests\PiwikTwigExtension; | ||
|
||
use PiwikTwigExtension\PiwikTwigExtension; | ||
use Twig_Test_IntegrationTestCase; | ||
|
||
class DisabledExtensionTest extends Twig_Test_IntegrationTestCase | ||
{ | ||
protected function getExtensions() | ||
{ | ||
return [ | ||
new PiwikTwigExtension(null, null, false), | ||
]; | ||
} | ||
|
||
protected function getFixturesDir() | ||
{ | ||
return __DIR__ . '/DisabledExtensionFixture/'; | ||
} | ||
} |