2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Tests for PMA_pow() function from common.lib.php
6 * @package phpMyAdmin-test
7 * @version $Id: PMA_pow_test.php
8 * @group common.lib-tests
14 require_once 'libraries/common.lib.php';
16 class PMA_pow_test
extends PHPUnit_Framework_TestCase
18 public function testIntOverflow()
20 $this->assertEquals('1267650600228229401496703205376',
24 public function testBcpow()
26 if (function_exists('bcpow')) {
27 $this->assertEquals('1267650600228229401496703205376',
28 PMA_pow(2, 100, 'bcpow'));
30 $this->markTestSkipped('function bcpow() does not exist');
34 public function testGmppow()
36 if (function_exists('gmp_pow')) {
37 $this->assertEquals('1267650600228229401496703205376',
38 PMA_pow(2, 100, 'gmp_pow'));
40 $this->markTestSkipped('function gmp_pow() does not exist');
44 public function _testNegativeExp()
46 $this->assertEquals(0.25,
50 public function _testNegativeExpPow()
52 if (function_exists('pow')) {
53 $this->assertEquals(0.25,
54 PMA_pow(2, -2, 'pow'));
56 $this->markTestSkipped('function pow() does not exist');
60 public function _testNegativeExpBcpow()
62 if (function_exists('bcpow')) {
63 $this->assertEquals(0.25,
64 PMA_pow(2, -2, 'bcpow'));
66 $this->markTestSkipped('function bcpow() does not exist');
70 public function _testNegativeExpGmppow()
72 if (function_exists('gmp_pow')) {
73 $this->assertEquals(0.25,
74 PMA_pow(2, -2, 'gmp_pow'));
76 $this->markTestSkipped('function gmp_pow() does not exist');