diff --git a/test/AllTests.php b/test/AllTests.php new file mode 100644 index 000000000..97c30da2a --- /dev/null +++ b/test/AllTests.php @@ -0,0 +1,44 @@ +addTestSuite('FailTest'); + $suite->addTestSuite('PMA_get_real_size_test'); + + return $suite; + } +} + +if (PMA_MAIN_METHOD == 'AllTests::main') { + AllTests::main(); +} +?> \ No newline at end of file diff --git a/test/FailTest.php b/test/FailTest.php new file mode 100644 index 000000000..c37cb3ac7 --- /dev/null +++ b/test/FailTest.php @@ -0,0 +1,22 @@ +assertEquals(0, 1); + } +} +?> \ No newline at end of file diff --git a/test/PMA_get_real_size_test.php b/test/PMA_get_real_size_test.php new file mode 100644 index 000000000..69bccb6db --- /dev/null +++ b/test/PMA_get_real_size_test.php @@ -0,0 +1,42 @@ +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')); + } +} +?> \ No newline at end of file