Merge branch '2.0-phpdoc'

This commit is contained in:
terrafrost 2015-04-16 00:54:23 -05:00
commit 8936593317
18 changed files with 144 additions and 145 deletions

View File

@ -255,7 +255,7 @@ class Blowfish extends Base
/**
* P-Array consists of 18 32-bit subkeys
*
* @var array $parray
* @var array
* @access private
*/
var $parray = array(
@ -269,7 +269,7 @@ class Blowfish extends Base
*
* Holds the expanded key [p] and the key-depended s-boxes [sb]
*
* @var array $bctx
* @var array
* @access private
*/
var $bctx;

View File

@ -138,7 +138,6 @@ class Rijndael extends Base
* because the encryption / decryption / key schedule creation requires this number and not $block_size. We could
* derive this from $block_size or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu
* of that, we'll just precompute it once.
*
*/
var $Nb = 4;

View File

@ -16,8 +16,8 @@
* if (!$ssh->login('username', 'password')) {
* exit('bad login');
* }
* $scp = new \phpseclib\Net\SCP($ssh);
* $scp->put('abcd', str_repeat('x', 1024*1024));
* ?>
* </code>

View File

@ -45,10 +45,10 @@ class Functional_Net_SFTPLargeFileTest extends PhpseclibFunctionalTestCase
}
/**
* @group github298
* @group github455
* @group github457
*/
* @group github298
* @group github455
* @group github457
*/
public function testPutSizeLocalFile()
{
$tmp_filename = $this->createTempFile(128, 1024 * 1024);

View File

@ -37,8 +37,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testConstructor
*/
* @depends testConstructor
*/
public function testPasswordLogin($sftp)
{
$username = $this->getEnv('SSH_USERNAME');
@ -52,8 +52,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testPasswordLogin
*/
* @depends testPasswordLogin
*/
public function testPwdHome($sftp)
{
$this->assertEquals(
@ -66,8 +66,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testPwdHome
*/
* @depends testPwdHome
*/
public function testMkDirScratch($sftp)
{
$dirname = self::$scratchDir;
@ -88,8 +88,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testMkDirScratch
*/
* @depends testMkDirScratch
*/
public function testChDirScratch($sftp)
{
$this->assertTrue(
@ -121,8 +121,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testChDirScratch
*/
* @depends testChDirScratch
*/
public function testStatOnDir($sftp)
{
$this->assertNotSame(
@ -135,8 +135,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testStatOnDir
*/
* @depends testStatOnDir
*/
public function testPutSizeGetFile($sftp)
{
$this->assertTrue(
@ -160,8 +160,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testPutSizeGetFile
*/
* @depends testPutSizeGetFile
*/
public function testTouch($sftp)
{
$this->assertTrue(
@ -178,8 +178,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testTouch
*/
* @depends testTouch
*/
public function testTruncate($sftp)
{
$this->assertTrue(
@ -202,8 +202,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testTruncate
*/
* @depends testTruncate
*/
public function testChDirOnFile($sftp)
{
$this->assertFalse(
@ -215,8 +215,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testChDirOnFile
*/
* @depends testChDirOnFile
*/
public function testFileExistsIsFileIsDirFile($sftp)
{
$this->assertTrue(
@ -238,8 +238,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testFileExistsIsFileIsDirFile
*/
* @depends testFileExistsIsFileIsDirFile
*/
public function testFileExistsIsFileIsDirFileNonexistent($sftp)
{
$this->assertFalse(
@ -261,8 +261,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testFileExistsIsFileIsDirFileNonexistent
*/
* @depends testFileExistsIsFileIsDirFileNonexistent
*/
public function testSortOrder($sftp)
{
$this->assertTrue(
@ -313,8 +313,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testSortOrder
*/
* @depends testSortOrder
*/
public function testResourceXfer($sftp)
{
$fp = fopen('res.txt', 'w+');
@ -333,8 +333,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testResourceXfer
*/
* @depends testResourceXfer
*/
public function testSymlink($sftp)
{
$this->assertTrue(
@ -346,8 +346,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testSymlink
*/
* @depends testSymlink
*/
public function testReadlink($sftp)
{
$this->assertInternalType('string', $sftp->readlink('symlink'),
@ -358,10 +358,10 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* on older versions this would result in a fatal error
* @depends testReadlink
* @group github402
*/
* on older versions this would result in a fatal error
* @depends testReadlink
* @group github402
*/
public function testStatcacheFix($sftp)
{
// Name used for both directory and file.
@ -383,8 +383,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testStatcacheFix
*/
* @depends testStatcacheFix
*/
public function testChDirUpHome($sftp)
{
$this->assertTrue(
@ -402,8 +402,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testChDirUpHome
*/
* @depends testChDirUpHome
*/
public function testFileExistsIsFileIsDirDir($sftp)
{
$this->assertTrue(
@ -425,8 +425,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testFileExistsIsFileIsDirDir
*/
* @depends testFileExistsIsFileIsDirDir
*/
public function testTruncateLargeFile($sftp)
{
$filesize = (4 * 1024 + 16) * 1024 * 1024;
@ -439,8 +439,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testTruncateLargeFile
*/
* @depends testTruncateLargeFile
*/
public function testRmDirScratch($sftp)
{
$this->assertFalse(
@ -453,8 +453,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testRmDirScratch
*/
* @depends testRmDirScratch
*/
public function testDeleteRecursiveScratch($sftp)
{
$this->assertTrue(
@ -467,8 +467,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
}
/**
* @depends testDeleteRecursiveScratch
*/
* @depends testDeleteRecursiveScratch
*/
public function testRmDirScratchNonexistent($sftp)
{
$this->assertFalse(

View File

@ -23,10 +23,10 @@ class Functional_Net_SSH2Test extends PhpseclibFunctionalTestCase
}
/**
* @depends testConstructor
* @group github408
* @group github412
*/
* @depends testConstructor
* @group github408
* @group github412
*/
public function testPreLogin($ssh)
{
$this->assertFalse(
@ -53,8 +53,8 @@ class Functional_Net_SSH2Test extends PhpseclibFunctionalTestCase
}
/**
* @depends testPreLogin
*/
* @depends testPreLogin
*/
public function testPasswordLogin($ssh)
{
$username = $this->getEnv('SSH_USERNAME');
@ -68,9 +68,9 @@ class Functional_Net_SSH2Test extends PhpseclibFunctionalTestCase
}
/**
* @depends testPasswordLogin
* @group github280
*/
* @depends testPasswordLogin
* @group github280
*/
public function testExecWithMethodCallback($ssh)
{
$callbackObject = $this->getMock('stdClass', array('callbackMethod'));

View File

@ -36,11 +36,11 @@ abstract class PhpseclibFunctionalTestCase extends PhpseclibTestCase
}
/**
* @param string $variable
* @param string|null $message
*
* @return null
*/
* @param string $variable
* @param string|null $message
*
* @return null
*/
protected function requireEnv($variable, $message = null)
{
if ($this->_getEnv($variable) === false) {
@ -53,10 +53,10 @@ abstract class PhpseclibFunctionalTestCase extends PhpseclibTestCase
}
/**
* @param string $variable
*
* @return string
*/
* @param string $variable
*
* @return string
*/
protected function getEnv($variable)
{
$this->requireEnv($variable);

View File

@ -20,17 +20,17 @@ abstract class PhpseclibTestCase extends PHPUnit_Framework_TestCase
}
/**
* Creates a temporary file on the local filesystem and returns its path.
* The $number_of_writes and $bytes_per_write parameters can be used to
* write $number_of_writes * $bytes_per_write times the character 'a' to the
* temporary file. All files created using this method will be deleted from
* the filesystem on tearDown(), i.e. after each test method was run.
*
* @param int $number_of_writes
* @param int $bytes_per_write
*
* @return string
*/
* Creates a temporary file on the local filesystem and returns its path.
* The $number_of_writes and $bytes_per_write parameters can be used to
* write $number_of_writes * $bytes_per_write times the character 'a' to the
* temporary file. All files created using this method will be deleted from
* the filesystem on tearDown(), i.e. after each test method was run.
*
* @param int $number_of_writes
* @param int $bytes_per_write
*
* @return string
*/
protected function createTempFile($number_of_writes = 0, $bytes_per_write = 0)
{
$filename = tempnam(sys_get_temp_dir(), 'phpseclib-test-');
@ -48,11 +48,11 @@ abstract class PhpseclibTestCase extends PHPUnit_Framework_TestCase
}
/**
* @param string $constant
* @param mixed $expected
*
* @return null
*/
* @param string $constant
* @param mixed $expected
*
* @return null
*/
static protected function ensureConstant($constant, $expected)
{
if (defined($constant)) {
@ -82,10 +82,10 @@ abstract class PhpseclibTestCase extends PHPUnit_Framework_TestCase
}
/**
* @param string $filename
*
* @return null
*/
* @param string $filename
*
* @return null
*/
static protected function reRequireFile($filename)
{
if (function_exists('runkit_import')) {

View File

@ -29,10 +29,10 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
}
/**
* Produces all combinations of test values.
*
* @return array
*/
* Produces all combinations of test values.
*
* @return array
*/
public function continuousBufferCombos()
{
$modes = array(
@ -70,8 +70,8 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
}
/**
* @dataProvider continuousBufferCombos
*/
* @dataProvider continuousBufferCombos
*/
public function testEncryptDecryptWithContinuousBuffer($mode, $plaintext, $iv, $key)
{
$aes = new AES($mode);
@ -91,8 +91,8 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
}
/**
* @group github451
*/
* @group github451
*/
public function testKeyPaddingRijndael()
{
// this test case is from the following URL:
@ -108,8 +108,8 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
}
/**
* @group github451
*/
* @group github451
*/
public function testKeyPaddingAES()
{
// same as the above - just with a different ciphertext

View File

@ -15,8 +15,8 @@ class Unit_Crypt_Hash_MD5Test extends Unit_Crypt_Hash_TestCase
}
/**
* @dataProvider hashData()
*/
* @dataProvider hashData()
*/
public function testHash($message, $result)
{
$this->assertHashesTo($this->getInstance(), $message, $result);
@ -32,8 +32,8 @@ class Unit_Crypt_Hash_MD5Test extends Unit_Crypt_Hash_TestCase
}
/**
* @dataProvider hmacData()
*/
* @dataProvider hmacData()
*/
public function testHMAC($key, $message, $result)
{
$this->assertHMACsTo($this->getInstance(), $key, $message, $result);

View File

@ -15,8 +15,8 @@ class Unit_Crypt_Hash_SHA256Test extends Unit_Crypt_Hash_TestCase
}
/**
* @dataProvider hashData()
*/
* @dataProvider hashData()
*/
public function testHash($message, $result)
{
$this->assertHashesTo($this->getInstance(), $message, $result);
@ -41,8 +41,8 @@ class Unit_Crypt_Hash_SHA256Test extends Unit_Crypt_Hash_TestCase
}
/**
* @dataProvider hmacData()
*/
* @dataProvider hmacData()
*/
public function testHMAC($key, $message, $result)
{
$this->assertHMACsTo($this->getInstance(), $key, $message, $result);

View File

@ -15,16 +15,16 @@ class Unit_Crypt_Hash_SHA256_96Test extends Unit_Crypt_Hash_SHA256Test
}
/**
* @dataProvider hashData()
*/
* @dataProvider hashData()
*/
public function testHash($message, $longResult)
{
parent::testHash($message, substr($longResult, 0, 24));
}
/**
* @dataProvider hmacData()
*/
* @dataProvider hmacData()
*/
public function testHMAC($key, $message, $longResult)
{
parent::testHMAC($key, $message, substr($longResult, 0, 24));

View File

@ -15,8 +15,8 @@ class Unit_Crypt_Hash_SHA512Test extends Unit_Crypt_Hash_TestCase
}
/**
* @dataProvider hashData()
*/
* @dataProvider hashData()
*/
public function testHash($message, $result)
{
$this->assertHashesTo($this->getInstance(), $message, $result);
@ -41,8 +41,8 @@ class Unit_Crypt_Hash_SHA512Test extends Unit_Crypt_Hash_TestCase
}
/**
* @dataProvider hmacData()
*/
* @dataProvider hmacData()
*/
public function testHMAC($key, $message, $result)
{
$this->assertHMACsTo($this->getInstance(), $key, $message, $result);

View File

@ -15,16 +15,16 @@ class Unit_Crypt_Hash_SHA512_96Test extends Unit_Crypt_Hash_SHA512Test
}
/**
* @dataProvider hashData()
*/
* @dataProvider hashData()
*/
public function testHash($message, $longResult)
{
parent::testHash($message, substr($longResult, 0, 24));
}
/**
* @dataProvider hmacData()
*/
* @dataProvider hmacData()
*/
public function testHMAC($key, $message, $longResult)
{
parent::testHMAC($key, $message, substr($longResult, 0, 24));

View File

@ -261,10 +261,10 @@ Ao8eayMp6FcvNucIpUndo1X8dKMv3Y26ZQIDAQAB
}
/**
* make phpseclib generated XML keys be unsigned. this may need to be reverted
* if it is later learned that XML keys are, in fact, supposed to be signed
* @group github468
*/
* make phpseclib generated XML keys be unsigned. this may need to be reverted
* if it is later learned that XML keys are, in fact, supposed to be signed
* @group github468
*/
public function testUnsignedXML()
{
$rsa = new RSA();
@ -282,8 +282,8 @@ Ao8eayMp6FcvNucIpUndo1X8dKMv3Y26ZQIDAQAB
}
/**
* @group github468
*/
* @group github468
*/
public function testSignedPKCS1()
{
$rsa = new RSA();

View File

@ -29,9 +29,9 @@ class Unit_Crypt_RandomTest extends PhpseclibTestCase
}
/**
* Takes a set of random values of length 128 bits and asserts all taken
* values are unique.
*/
* Takes a set of random values of length 128 bits and asserts all taken
* values are unique.
*/
public function testStringUniqueness()
{
$values = array();

View File

@ -10,9 +10,9 @@ use phpseclib\File\ASN1;
class Unit_File_ASN1Test extends PhpseclibTestCase
{
/**
* on older versions of \phpseclib\File\ASN1 this would yield a PHP Warning
* @group github275
*/
* on older versions of \phpseclib\File\ASN1 this would yield a PHP Warning
* @group github275
*/
public function testAnyString()
{
$KDC_REP = array(
@ -83,9 +83,9 @@ class Unit_File_ASN1Test extends PhpseclibTestCase
}
/**
* on older versions of \phpseclib\File\ASN1 this would produce a null instead of an array
* @group github275
*/
* on older versions of \phpseclib\File\ASN1 this would produce a null instead of an array
* @group github275
*/
public function testIncorrectString()
{
$PA_DATA = array(
@ -235,8 +235,8 @@ class Unit_File_ASN1Test extends PhpseclibTestCase
}
/**
* older versions of ASN1 didn't handle indefinite length tags very well
*/
* older versions of ASN1 didn't handle indefinite length tags very well
*/
public function testIndefiniteLength()
{
$asn1 = new ASN1();
@ -270,8 +270,8 @@ class Unit_File_ASN1Test extends PhpseclibTestCase
}
/**
* @group github477
*/
* @group github477
*/
public function testContextSpecificNonConstructed()
{
$asn1 = new ASN1();
@ -280,8 +280,8 @@ class Unit_File_ASN1Test extends PhpseclibTestCase
}
/**
* @group github602
*/
* @group github602
*/
public function testEmptyContextTag()
{
$asn1 = new ASN1();

View File

@ -295,8 +295,8 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
}
/**
* @group github279
*/
* @group github279
*/
public function testDiffieHellmanKeyAgreement()
{
if (getenv('TRAVIS') && PHP_VERSION === '5.3.3'