From 991c2308cc64afcedca37a48e19bb8f17bdac2dc Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Thu, 8 Mar 2007 16:57:02 +0000 Subject: [PATCH] added testcase for PMA_get_real_size_test.php() --- test/AllTests.php | 44 +++++++++++++++++++++++++++++++++ test/FailTest.php | 22 +++++++++++++++++ test/PMA_get_real_size_test.php | 42 +++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 test/AllTests.php create mode 100644 test/FailTest.php create mode 100644 test/PMA_get_real_size_test.php 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