Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve consistency of docblocks
  • Loading branch information
Zuluru committed Dec 13, 2016
1 parent 520926f commit 0bfad80
Show file tree
Hide file tree
Showing 2 changed files with 422 additions and 106 deletions.
130 changes: 103 additions & 27 deletions tests/TestCase/Controller/Component/SecurityComponentTest.php
Expand Up @@ -143,6 +143,8 @@ class SecurityComponentTest extends TestCase
/**
* setUp method
*
* Initializes environment state.
*
* @return void
*/
public function setUp()
Expand All @@ -169,7 +171,9 @@ public function setUp()
}

/**
* Tear-down method. Resets environment state.
* tearDown method
*
* Resets environment state.
*
* @return void
*/
Expand All @@ -195,8 +199,10 @@ public function validatePost($expectedException = null, $expectedExceptionMessag
}

/**
* testBlackholeWithBrokenCallback method
*
* Test that requests are still blackholed when controller has incorrect
* visibility keyword in the blackhole callback
* visibility keyword in the blackhole callback.
*
* @expectedException \Cake\Network\Exception\BadRequestException
* @return void
Expand All @@ -221,6 +227,8 @@ public function testBlackholeWithBrokenCallback()
}

/**
* testExceptionWhenActionIsBlackholeCallback method
*
* Ensure that directly requesting the blackholeCallback as the controller
* action results in an exception.
*
Expand All @@ -240,7 +248,9 @@ public function testExceptionWhenActionIsBlackholeCallback()
}

/**
* test that initialize can set properties.
* testConstructorSettingProperties method
*
* Test that initialize can set properties.
*
* @return void
*/
Expand Down Expand Up @@ -404,6 +414,8 @@ public function testRequireAuthSucceed()
}

/**
* testValidatePost method
*
* Simple hash validation test
*
* @return void
Expand All @@ -426,6 +438,8 @@ public function testValidatePost()
}

/**
* testValidatePostOnGetWithData method
*
* Test that validatePost fires on GET with request data.
* This could happen when method overriding is used.
*
Expand Down Expand Up @@ -455,6 +469,8 @@ public function testValidatePostOnGetWithData()
}

/**
* testValidatePostNoSession method
*
* Test that validatePost fails if you are missing the session information.
*
* @return void
Expand Down Expand Up @@ -482,6 +498,8 @@ public function testValidatePostNoSession()
}

/**
* testValidatePostNoUnlockedInRequestData method
*
* Test that validatePost fails if you are missing unlocked in request data.
*
* @return void
Expand All @@ -503,7 +521,9 @@ public function testValidatePostNoUnlockedInRequestData()
}

/**
* test that validatePost fails if any of its required fields are missing.
* testValidatePostFormHacking method
*
* Test that validatePost fails if any of its required fields are missing.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand All @@ -523,6 +543,8 @@ public function testValidatePostFormHacking()
}

/**
* testValidatePostObjectDeserialize
*
* Test that objects can't be passed into the serialized string. This was a vector for RFI and LFI
* attacks. Thanks to Felix Wilhelm
*
Expand Down Expand Up @@ -554,6 +576,8 @@ public function testValidatePostObjectDeserialize()
}

/**
* testValidatePostIgnoresCsrfToken method
*
* Tests validation post data ignores `_csrfToken`.
*
* @return void
Expand All @@ -577,7 +601,9 @@ public function testValidatePostIgnoresCsrfToken()
}

/**
* Tests validation of checkbox arrays
* testValidatePostArray method
*
* Tests validation of checkbox arrays.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand Down Expand Up @@ -609,6 +635,8 @@ public function testValidatePostArray()
}

/**
* testValidateIntFieldName method
*
* Tests validation of integer field names.
*
* @return void
Expand Down Expand Up @@ -682,7 +710,9 @@ public function testValidatePostSimple()
}

/**
* Tests hash validation for multiple records, including locked fields
* testValidatePostComplex method
*
* Tests hash validation for multiple records, including locked fields.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand Down Expand Up @@ -714,7 +744,9 @@ public function testValidatePostComplex()
}

/**
* test ValidatePost with multiple select elements.
* testValidatePostMultipleSelect method
*
* Test ValidatePost with multiple select elements.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand Down Expand Up @@ -858,7 +890,9 @@ public function testValidatePostWithDisabledFields()
}

/**
* test validating post data with posted unlocked fields.
* testValidatePostDisabledFieldsInData method
*
* Test validating post data with posted unlocked fields.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand Down Expand Up @@ -886,7 +920,9 @@ public function testValidatePostDisabledFieldsInData()
}

/**
* test that missing 'unlocked' input causes failure
* testValidatePostFailNoDisabled method
*
* Test that missing 'unlocked' input causes failure.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand All @@ -912,7 +948,9 @@ public function testValidatePostFailNoDisabled()
}

/**
* test that missing 'debug' input causes failure
* testValidatePostFailNoDebug method
*
* Test that missing 'debug' input causes failure.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand All @@ -939,7 +977,9 @@ public function testValidatePostFailNoDebug()
}

/**
* test that missing 'debug' input is not the problem when debug mode disabled
* testValidatePostFailNoDebugMode method
*
* Test that missing 'debug' input is not the problem when debug mode disabled.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand All @@ -965,6 +1005,8 @@ public function testValidatePostFailNoDebugMode()
}

/**
* testValidatePostFailDisabledFieldTampering method
*
* Test that validatePost fails when unlocked fields are changed.
*
* @return void
Expand Down Expand Up @@ -1102,6 +1144,8 @@ public function testValidateHasManyRecordsPass()
}

/**
* testValidateNestedNumericSets method
*
* Test that values like Foo.0.1
*
* @return void
Expand Down Expand Up @@ -1233,7 +1277,9 @@ public function testFormDisabledFields()
}

/**
* test validatePost with radio buttons
* testValidatePostRadio method
*
* Test validatePost with radio buttons.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand Down Expand Up @@ -1279,7 +1325,9 @@ public function testValidatePostRadio()
}

/**
* test validatePost uses here() as a hash input.
* testValidatePostUrlAsHashInput method
*
* Test validatePost uses here() as a hash input.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand Down Expand Up @@ -1321,7 +1369,9 @@ public function testValidatePostUrlAsHashInput()
}

/**
* test that blackhole doesn't delete the _Token session key so repeat data submissions
* testBlackHoleNotDeletingSessionInformation method
*
* Test that blackhole doesn't delete the _Token session key so repeat data submissions
* stay blackholed.
*
* @return void
Expand All @@ -1337,7 +1387,9 @@ public function testBlackHoleNotDeletingSessionInformation()
}

/**
* Test generateToken()
* testGenerateToken method
*
* Test generateToken().
*
* @return void
*/
Expand All @@ -1351,7 +1403,9 @@ public function testGenerateToken()
}

/**
* Test unlocked actions
* testUnlockedActions method
*
* Test unlocked actions.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand All @@ -1368,7 +1422,9 @@ public function testUnlockedActions()
}

/**
* Test that debug token format is right
* testValidatePostDebugFormat method
*
* Test that debug token format is right.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand Down Expand Up @@ -1405,7 +1461,9 @@ public function testValidatePostDebugFormat()
}

/**
* test blackhole will now throw passed exception if debug enabled
* testBlackholeThrowsException method
*
* Test blackhole will now throw passed exception if debug enabled.
*
* @expectedException \Cake\Controller\Exception\SecurityException
* @expectedExceptionMessage error description
Expand All @@ -1418,7 +1476,9 @@ public function testBlackholeThrowsException()
}

/**
* test blackhole will throw BadRequest if debug disabled
* testBlackholeThrowsBadRequest method
*
* Test blackhole will throw BadRequest if debug disabled.
*
* @return void
*/
Expand All @@ -1439,7 +1499,9 @@ public function testBlackholeThrowsBadRequest()
}

/**
* Test that validatePost fails with tampered fields and explanation
* testValidatePostFailTampering method
*
* Test that validatePost fails with tampered fields and explanation.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand Down Expand Up @@ -1470,7 +1532,9 @@ public function testValidatePostFailTampering()
}

/**
* Test that validatePost fails with tampered fields and explanation
* testValidatePostFailTamperingMutatedIntoArray method
*
* Test that validatePost fails with tampered fields and explanation.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand Down Expand Up @@ -1501,7 +1565,9 @@ public function testValidatePostFailTamperingMutatedIntoArray()
}

/**
* Test that debug token should not be sent if debug is disabled
* testValidatePostUnexpectedDebugToken method
*
* Test that debug token should not be sent if debug is disabled.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand Down Expand Up @@ -1532,7 +1598,9 @@ public function testValidatePostUnexpectedDebugToken()
}

/**
* Auth required throws exception token not found
* testAuthRequiredThrowsExceptionTokenNotFoundPost method
*
* Auth required throws exception token not found.
*
* @return void
* @expectedException \Cake\Controller\Exception\AuthSecurityException
Expand All @@ -1548,7 +1616,9 @@ public function testAuthRequiredThrowsExceptionTokenNotFoundPost()
}

/**
* Auth required throws exception token not found in Session
* testAuthRequiredThrowsExceptionTokenNotFoundSession method
*
* Auth required throws exception token not found in Session.
*
* @return void
* @expectedException \Cake\Controller\Exception\AuthSecurityException
Expand All @@ -1564,7 +1634,9 @@ public function testAuthRequiredThrowsExceptionTokenNotFoundSession()
}

/**
* Auth required throws exception controller not allowed
* testAuthRequiredThrowsExceptionControllerNotAllowed method
*
* Auth required throws exception controller not allowed.
*
* @return void
* @expectedException \Cake\Controller\Exception\AuthSecurityException
Expand All @@ -1584,7 +1656,9 @@ public function testAuthRequiredThrowsExceptionControllerNotAllowed()
}

/**
* Auth required throws exception controller not allowed
* testAuthRequiredThrowsExceptionActionNotAllowed method
*
* Auth required throws exception controller not allowed.
*
* @return void
* @expectedException \Cake\Controller\Exception\AuthSecurityException
Expand All @@ -1604,7 +1678,9 @@ public function testAuthRequiredThrowsExceptionActionNotAllowed()
}

/**
* Auth required throws exception controller not allowed
* testAuthRequired method
*
* Auth required throws exception controller not allowed.
*
* @return void
* @triggers Controller.startup $this->Controller
Expand Down

0 comments on commit 0bfad80

Please sign in to comment.