fixed/added svn properties
This commit is contained in:
@@ -1,59 +1,59 @@
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* runs all defined tests
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
if (! defined('PMA_MAIN_METHOD')) {
|
||||
define('PMA_MAIN_METHOD', 'AllTests::main');
|
||||
chdir('..');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once 'PHPUnit/TextUI/TestRunner.php';
|
||||
//require_once 'PHPUnit/Util/TestDox/ResultPrinter.php.';
|
||||
require_once './test/FailTest.php';
|
||||
require_once './test/PMA_get_real_size_test.php';
|
||||
require_once './test/PMA_sanitize_test.php';
|
||||
require_once './test/PMA_pow_test.php';
|
||||
require_once './test/Environment_test.php';
|
||||
require_once './test/escape_js_string.php';
|
||||
|
||||
class AllTests
|
||||
{
|
||||
public static function main()
|
||||
{
|
||||
$parameters = array();
|
||||
//$parameters['testdoxHTMLFile'] = true;
|
||||
//$parameters['printer'] = PHPUnit_Util_TestDox_ResultPrinter::factory('HTML');
|
||||
//$parameters['printer'] = PHPUnit_Util_TestDox_ResultPrinter::factory('Text');
|
||||
PHPUnit_TextUI_TestRunner::run(self::suite(), $parameters);
|
||||
}
|
||||
|
||||
public static function suite()
|
||||
{
|
||||
$suite = new PHPUnit_Framework_TestSuite('phpMyAdmin');
|
||||
|
||||
//$suite->addTestSuite('FailTest');
|
||||
$suite->addTestSuite('Environment_test');
|
||||
$suite->addTestSuite('PMA_get_real_size_test');
|
||||
$suite->addTestSuite('PMA_sanitize_test');
|
||||
$suite->addTestSuite('PMA_pow_test');
|
||||
$suite->addTestSuite('PMA_escapeJsString_test');
|
||||
return $suite;
|
||||
}
|
||||
}
|
||||
|
||||
if (PMA_MAIN_METHOD == 'AllTests::main') {
|
||||
echo '<pre>';
|
||||
AllTests::main();
|
||||
echo '</pre>';
|
||||
}
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* runs all defined tests
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
if (! defined('PMA_MAIN_METHOD')) {
|
||||
define('PMA_MAIN_METHOD', 'AllTests::main');
|
||||
chdir('..');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once 'PHPUnit/TextUI/TestRunner.php';
|
||||
//require_once 'PHPUnit/Util/TestDox/ResultPrinter.php.';
|
||||
require_once './test/FailTest.php';
|
||||
require_once './test/PMA_get_real_size_test.php';
|
||||
require_once './test/PMA_sanitize_test.php';
|
||||
require_once './test/PMA_pow_test.php';
|
||||
require_once './test/Environment_test.php';
|
||||
require_once './test/escape_js_string.php';
|
||||
|
||||
class AllTests
|
||||
{
|
||||
public static function main()
|
||||
{
|
||||
$parameters = array();
|
||||
//$parameters['testdoxHTMLFile'] = true;
|
||||
//$parameters['printer'] = PHPUnit_Util_TestDox_ResultPrinter::factory('HTML');
|
||||
//$parameters['printer'] = PHPUnit_Util_TestDox_ResultPrinter::factory('Text');
|
||||
PHPUnit_TextUI_TestRunner::run(self::suite(), $parameters);
|
||||
}
|
||||
|
||||
public static function suite()
|
||||
{
|
||||
$suite = new PHPUnit_Framework_TestSuite('phpMyAdmin');
|
||||
|
||||
//$suite->addTestSuite('FailTest');
|
||||
$suite->addTestSuite('Environment_test');
|
||||
$suite->addTestSuite('PMA_get_real_size_test');
|
||||
$suite->addTestSuite('PMA_sanitize_test');
|
||||
$suite->addTestSuite('PMA_pow_test');
|
||||
$suite->addTestSuite('PMA_escapeJsString_test');
|
||||
return $suite;
|
||||
}
|
||||
}
|
||||
|
||||
if (PMA_MAIN_METHOD == 'AllTests::main') {
|
||||
echo '<pre>';
|
||||
AllTests::main();
|
||||
echo '</pre>';
|
||||
}
|
||||
?>
|
@@ -1,33 +1,33 @@
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for environment like OS, PHP, modules, ...
|
||||
*
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
|
||||
class Environment_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testPhpVersion()
|
||||
{
|
||||
$this->assertTrue(version_compare('4.1', phpversion(), '<='),
|
||||
'phpMyAdmin requires PHP 4.1 or above');
|
||||
}
|
||||
|
||||
public function testMySQL()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
public function testSession()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for environment like OS, PHP, modules, ...
|
||||
*
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
|
||||
class Environment_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testPhpVersion()
|
||||
{
|
||||
$this->assertTrue(version_compare('4.1', phpversion(), '<='),
|
||||
'phpMyAdmin requires PHP 4.1 or above');
|
||||
}
|
||||
|
||||
public function testMySQL()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
public function testSession()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
}
|
||||
?>
|
@@ -1,23 +1,23 @@
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for PMA_get_real_size()
|
||||
*
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once './libraries/common.lib.php';
|
||||
|
||||
class FailTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testFail()
|
||||
{
|
||||
$this->assertEquals(0, 1);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for PMA_get_real_size()
|
||||
*
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once './libraries/common.lib.php';
|
||||
|
||||
class FailTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testFail()
|
||||
{
|
||||
$this->assertEquals(0, 1);
|
||||
}
|
||||
}
|
||||
?>
|
@@ -1,43 +1,43 @@
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for PMA_get_real_size()
|
||||
*
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once './libraries/common.lib.php';
|
||||
|
||||
class PMA_get_real_size_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testNull()
|
||||
{
|
||||
$this->assertEquals(0, PMA_get_real_size('0'));
|
||||
}
|
||||
|
||||
public function testKilobyte()
|
||||
{
|
||||
$this->assertEquals(1024, PMA_get_real_size('1kb'));
|
||||
}
|
||||
|
||||
public function testKilobyte2()
|
||||
{
|
||||
$this->assertEquals(1024 * 1024, PMA_get_real_size('1024k'));
|
||||
}
|
||||
|
||||
public function testMegabyte()
|
||||
{
|
||||
$this->assertEquals(8 * 1024 * 1024, PMA_get_real_size('8m'));
|
||||
}
|
||||
|
||||
public function testGigabyte()
|
||||
{
|
||||
$this->assertEquals(12 * 1024 * 1024 * 1024, PMA_get_real_size('12gb'));
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for PMA_get_real_size()
|
||||
*
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once './libraries/common.lib.php';
|
||||
|
||||
class PMA_get_real_size_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testNull()
|
||||
{
|
||||
$this->assertEquals(0, PMA_get_real_size('0'));
|
||||
}
|
||||
|
||||
public function testKilobyte()
|
||||
{
|
||||
$this->assertEquals(1024, PMA_get_real_size('1kb'));
|
||||
}
|
||||
|
||||
public function testKilobyte2()
|
||||
{
|
||||
$this->assertEquals(1024 * 1024, PMA_get_real_size('1024k'));
|
||||
}
|
||||
|
||||
public function testMegabyte()
|
||||
{
|
||||
$this->assertEquals(8 * 1024 * 1024, PMA_get_real_size('8m'));
|
||||
}
|
||||
|
||||
public function testGigabyte()
|
||||
{
|
||||
$this->assertEquals(12 * 1024 * 1024 * 1024, PMA_get_real_size('12gb'));
|
||||
}
|
||||
}
|
||||
?>
|
@@ -1,50 +1,50 @@
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for PMA_pow()
|
||||
*
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once './libraries/common.lib.php';
|
||||
|
||||
class PMA_pow_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testIntOverflow()
|
||||
{
|
||||
$this->assertEquals('1267650600228229401496703205376',
|
||||
PMA_pow(2, 100));
|
||||
}
|
||||
|
||||
public function testBcpow()
|
||||
{
|
||||
if (function_exists('bcpow')) {
|
||||
$this->assertEquals('1267650600228229401496703205376',
|
||||
PMA_pow(2, 100, 'bcpow'));
|
||||
} else {
|
||||
$this->markTestSkipped('function bcpow() does not exist');
|
||||
}
|
||||
}
|
||||
|
||||
public function testGmppow()
|
||||
{
|
||||
if (function_exists('gmp_pow')) {
|
||||
$this->assertEquals('1267650600228229401496703205376',
|
||||
PMA_pow(2, 100, 'gmp_pow'));
|
||||
} else {
|
||||
$this->markTestSkipped('function gmp_pow() does not exist');
|
||||
}
|
||||
}
|
||||
|
||||
public function testNegativeExp()
|
||||
{
|
||||
$this->assertEquals(false,
|
||||
PMA_pow(2, -1));
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for PMA_pow()
|
||||
*
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once './libraries/common.lib.php';
|
||||
|
||||
class PMA_pow_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testIntOverflow()
|
||||
{
|
||||
$this->assertEquals('1267650600228229401496703205376',
|
||||
PMA_pow(2, 100));
|
||||
}
|
||||
|
||||
public function testBcpow()
|
||||
{
|
||||
if (function_exists('bcpow')) {
|
||||
$this->assertEquals('1267650600228229401496703205376',
|
||||
PMA_pow(2, 100, 'bcpow'));
|
||||
} else {
|
||||
$this->markTestSkipped('function bcpow() does not exist');
|
||||
}
|
||||
}
|
||||
|
||||
public function testGmppow()
|
||||
{
|
||||
if (function_exists('gmp_pow')) {
|
||||
$this->assertEquals('1267650600228229401496703205376',
|
||||
PMA_pow(2, 100, 'gmp_pow'));
|
||||
} else {
|
||||
$this->markTestSkipped('function gmp_pow() does not exist');
|
||||
}
|
||||
}
|
||||
|
||||
public function testNegativeExp()
|
||||
{
|
||||
$this->assertEquals(false,
|
||||
PMA_pow(2, -1));
|
||||
}
|
||||
}
|
||||
?>
|
@@ -1,42 +1,42 @@
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for PMA_sanitize()
|
||||
*
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once './libraries/sanitizing.lib.php';
|
||||
|
||||
class PMA_sanitize_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testXssInHref()
|
||||
{
|
||||
$this->assertEquals('[a@javascript:alert(\'XSS\');@target]link</a>',
|
||||
PMA_sanitize('[a@javascript:alert(\'XSS\');@target]link[/a]'));
|
||||
}
|
||||
|
||||
public function testLink()
|
||||
{
|
||||
$this->assertEquals('<a href="http://www.phpmyadmin.net/" target="target">link</a>',
|
||||
PMA_sanitize('[a@http://www.phpmyadmin.net/@target]link[/a]'));
|
||||
}
|
||||
|
||||
public function testHtmlTags()
|
||||
{
|
||||
$this->assertEquals('<div onclick="">',
|
||||
PMA_sanitize('<div onclick="">'));
|
||||
}
|
||||
|
||||
public function testBbcoe()
|
||||
{
|
||||
$this->assertEquals('<strong>strong</strong>',
|
||||
PMA_sanitize('[b]strong[/b]'));
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/* vim: expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for PMA_sanitize()
|
||||
*
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once './libraries/sanitizing.lib.php';
|
||||
|
||||
class PMA_sanitize_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testXssInHref()
|
||||
{
|
||||
$this->assertEquals('[a@javascript:alert(\'XSS\');@target]link</a>',
|
||||
PMA_sanitize('[a@javascript:alert(\'XSS\');@target]link[/a]'));
|
||||
}
|
||||
|
||||
public function testLink()
|
||||
{
|
||||
$this->assertEquals('<a href="http://www.phpmyadmin.net/" target="target">link</a>',
|
||||
PMA_sanitize('[a@http://www.phpmyadmin.net/@target]link[/a]'));
|
||||
}
|
||||
|
||||
public function testHtmlTags()
|
||||
{
|
||||
$this->assertEquals('<div onclick="">',
|
||||
PMA_sanitize('<div onclick="">'));
|
||||
}
|
||||
|
||||
public function testBbcoe()
|
||||
{
|
||||
$this->assertEquals('<strong>strong</strong>',
|
||||
PMA_sanitize('[b]strong[/b]'));
|
||||
}
|
||||
}
|
||||
?>
|
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* @author Michal Čihař <michal@cihar.com>
|
||||
* @package phpMyAdmin-test
|
||||
* @version $Id: common.lib.php 9832 2007-01-09 09:50:49Z nijel $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user