Skip to content

Commit

Permalink
Merge pull request #7 from Mac2k3/fix-accessible-helper
Browse files Browse the repository at this point in the history
Changed regular expression matching
  • Loading branch information
elblinkin committed Aug 8, 2013
2 parents b6ece92 + fad19b1 commit f04f24e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PHPUnit/Extensions/Helper/AccessibleObject.php
Expand Up @@ -2,7 +2,7 @@

class PHPUnit_Extensions_Helper_AccessibleObject {

const REGEX_ACCESSIBLE = '/@accessibleForTesting\s*$/';
const REGEX_ACCESSIBLE = '/@accessibleForTesting\s*$|\n/';

private $object;
private $reflection_class;
Expand Down
17 changes: 17 additions & 0 deletions Tests/Extensions/Helper/AccessibleObjectTest.php
Expand Up @@ -68,6 +68,13 @@ public function testPublicVar_unset() {
unset($this->accessibleObject->public_var);
$this->assertFalse(isset($this->accessibleObject->public_var));
}

public function testProtectedMultipleCommentMethod_accessible() {
$this->assertEquals(
'accessible protected multi comment called',
$this->accessibleObject->accessibleMultiCommentMethod()
);
}
}

class Tests_Extensions_Helper_AccessibleObject_Object {
Expand Down Expand Up @@ -98,4 +105,14 @@ protected function accessibleProtectedMethod() {
public function publicMethod() {
return 'public called';
}

/**
* This is a test function
*
* @accessibleForTesting
* @return string
*/
protected function accessibleMultiCommentMethod() {
return 'accessible protected multi comment called';
}
}

0 comments on commit f04f24e

Please sign in to comment.