diff options
author | d-skora <d.skora@clearcode.cc> | 2014-10-06 20:05:42 +0400 |
---|---|---|
committer | d-skora <d.skora@clearcode.cc> | 2014-10-15 14:44:37 +0400 |
commit | e22ac8b2f0580ea76231acf930a2d1a56e1cad3b (patch) | |
tree | 9a058b655adac0ae938f0a65e20f35ac1f6606d9 /tests/PHPUnit/Core | |
parent | fa99aef41e32849921f90d3b4d3ab0b5c0019004 (diff) |
refactoring of code, fixes for hiding classes
Diffstat (limited to 'tests/PHPUnit/Core')
-rw-r--r-- | tests/PHPUnit/Core/API/DocumentationGeneratorTest.php | 15 |
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 |