[Cs-webapplibs-commits] SF.net SVN: cs-webapplibs:[132] trunk/0.3/tests/testOfCSWebAppLibs.php
Status: Beta
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-08-21 16:34:48
|
Revision: 132 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=132&view=rev Author: crazedsanity Date: 2009-08-21 16:34:42 +0000 (Fri, 21 Aug 2009) Log Message: ----------- Change basic_token_tests() to do_tokenTest(), as the previous was too close to "test_token_basics()". Modified Paths: -------------- trunk/0.3/tests/testOfCSWebAppLibs.php Modified: trunk/0.3/tests/testOfCSWebAppLibs.php =================================================================== --- trunk/0.3/tests/testOfCSWebAppLibs.php 2009-08-21 16:30:05 UTC (rev 131) +++ trunk/0.3/tests/testOfCSWebAppLibs.php 2009-08-21 16:34:42 UTC (rev 132) @@ -73,7 +73,7 @@ //Generic test to ensure we get the appropriate data back. { $tokenData = $tok->create_token(1, 'test', 'abc123'); - $this->basic_token_tests($tokenData, 1, 'test'); + $this->do_tokenTest($tokenData, 1, 'test'); $this->assertEqual($tok->authenticate_token($tokenData['id'], 'test', $tokenData['hash']), 1); $this->assertFalse($tok->authenticate_token($tokenData['id'], 'testx', $tokenData['hash'])); @@ -91,7 +91,7 @@ { //Generic test to ensure we get the appropriate data back. $tokenData = $tok->create_token(1, 'test', 'abc123', null, 1); - $this->basic_token_tests($tokenData, 1, 'test'); + $this->do_tokenTest($tokenData, 1, 'test'); $this->assertEqual($tok->authenticate_token($tokenData['id'], 'test', $tokenData['hash']), 1); $this->assertTrue(($tok->authenticate_token($tokenData['id'], 'test', $tokenData['hash']) === null), @@ -105,7 +105,7 @@ { //Generic test to ensure we get the appropriate data back. $tokenData = $tok->create_token(1, 'test', 'abc123', '2 years'); - $this->basic_token_tests($tokenData, 1, 'test'); + $this->do_tokenTest($tokenData, 1, 'test'); $this->assertEqual($tok->authenticate_token($tokenData['id'], 'test', $tokenData['hash']), 1); $checkAttempts = 100; @@ -122,7 +122,7 @@ //try to create a token with max_uses of 0. { $tokenData = $tok->create_token(2, 'test', 'xxxxyyyyyxxxx', null, 0); - $this->basic_token_tests($tokenData, 2, 'test'); + $this->do_tokenTest($tokenData, 2, 'test'); $checkData = $tok->tokenData($tokenData['id']); $this->assertTrue(is_array($checkData)); @@ -134,7 +134,7 @@ { $tokenData = $tok->create_token(88, 'test', 'This is a big old TEST', '-3 days'); if($this->assertTrue(is_array($tokenData))) { - $this->basic_token_tests($tokenData, 88, 'test'); + $this->do_tokenTest($tokenData, 88, 'test'); $this->assertFalse($tok->authenticate_token($tokenData['id'], 'test', $tokenData['hash'])); } } @@ -173,7 +173,7 @@ $hashThis = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ut."; $tokenData = $tok->create_token($uid, $checksum, $hashThis); - $this->basic_token_tests($tokenData, $uid, $checksum); + $this->do_tokenTest($tokenData, $uid, $checksum); $this->assertNotEqual($tokenData['hash'], $tok->doHash($tokenData['id'], $uid, $checksum, $hashThis), "hash is guessable"); @@ -184,7 +184,7 @@ //-------------------------------------------------------------------------- - private function basic_token_tests(array $tokenData, $uid, $checksum) { + private function do_tokenTest(array $tokenData, $uid, $checksum) { if($this->assertTrue(is_array($tokenData)) && $this->assertTrue(is_numeric($uid)) && $this->assertTrue(strlen($checksum))) { @@ -196,7 +196,7 @@ $this->assertTrue((strlen($tokenData['hash']) == 40)); } - }//end basic_token_tests() + }//end do_tokenTest() //-------------------------------------------------------------------------- } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |