Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authord-skora <d.skora@clearcode.cc>2014-10-06 20:05:42 +0400
committerd-skora <d.skora@clearcode.cc>2014-10-15 14:44:37 +0400
commite22ac8b2f0580ea76231acf930a2d1a56e1cad3b (patch)
tree9a058b655adac0ae938f0a65e20f35ac1f6606d9 /tests/PHPUnit/Core
parentfa99aef41e32849921f90d3b4d3ab0b5c0019004 (diff)
refactoring of code, fixes for hiding classes
Diffstat (limited to 'tests/PHPUnit/Core')
-rw-r--r--tests/PHPUnit/Core/API/DocumentationGeneratorTest.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/PHPUnit/Core/API/DocumentationGeneratorTest.php b/tests/PHPUnit/Core/API/DocumentationGeneratorTest.php
index 2d99325ee7..9d1ad4faa4 100644
--- a/tests/PHPUnit/Core/API/DocumentationGeneratorTest.php
+++ b/tests/PHPUnit/Core/API/DocumentationGeneratorTest.php
@@ -19,7 +19,7 @@ class DocumentationGeneratorTest extends PHPUnit_Framework_TestCase
{
public function testCheckIfModuleContainsHideAnnotation()
{
- $annotation = '@hide ExceptForSuperUser test test';
+ $annotation = '@hideExceptForSuperUser test test';
$mock = $this->getMockBuilder('ReflectionClass')
->disableOriginalConstructor()
->setMethods(array('getDocComment'))
@@ -28,25 +28,22 @@ class DocumentationGeneratorTest extends PHPUnit_Framework_TestCase
$documentationGenerator = new DocumentationGenerator();
$this->assertTrue($documentationGenerator->checkIfClassCommentContainsHideAnnotation($mock));
}
+
public function testCheckDocumentation()
{
- $moduleToCheck = 'this is documentation which contains @hide ExceptForSuperUser';
+ $moduleToCheck = 'this is documentation which contains @hideExceptForSuperUser';
$documentationAfterCheck = 'this is documentation which contains ';
$documentationGenerator = new DocumentationGenerator();
$this->assertEquals($documentationGenerator->checkDocumentation($moduleToCheck), $documentationAfterCheck);
}
+
public function testCheckIfMethodCommentContainsHideAnnotation()
{
- $annotation = '@hide ForAll test test';
- $mock = $this->getMockBuilder('ReflectionMethod')
- ->disableOriginalConstructor()
- ->setMethods(array('getDocComment'))
- ->getMock();
- $mock->expects($this->once())->method('getDocComment')->willReturn($annotation);
+ $annotation = '@hideForAll test test';
EventDispatcher::getInstance()->addObserver('API.DocumentationGenerator.hideForAll',
function (&$response) {
$response = true;
});
- $this->assertEquals(Proxy::getInstance()->checkIfMethodContainsHideAnnotation($mock), true);
+ $this->assertEquals(Proxy::getInstance()->checkIfDocContainsHideAnnotation($annotation), true);
}
} \ No newline at end of file