3 namespace RedUNIT\Base;
5 use RedUNIT\Base as Base;
6 use RedBeanPHP\Facade as R;
9 * Large Number Limit Test (issue #386)
11 * Tests whether we can use large numbers for limit clause.
13 * @file RedUNIT/Base/Largenum.php
14 * @desc Test whether we can use large numbers in LIMIT clause (PDO bindings).
15 * @author Gabor de Mooij and the RedBeanPHP Community
16 * @license New BSD/GPLv2
18 * (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
19 * This source file is subject to the New BSD/GPLv2 License that is bundled
20 * with this source code in the file license.txt.
22 class Largenum extends Base
25 * Test for issue #386.
26 * Can we use large numbers in LIMIT ?
30 public function testLargeNum()
32 if ( defined( 'HHVM_VERSION' ) ) return; //oops hhvm has incorrect binding for large nums.
33 $number = R::dispense( 'number' );
34 $number->name = 'big number';
36 //This should not cause an error... (some people use LIMIT 0, HUGE to simulate OFFSET on MYSQL).
37 $beans = R::findAll( 'number', ' LIMIT ? ', array( PHP_INT_MAX ) );
38 asrt( is_array( $beans ), TRUE );
39 asrt( count( $beans ), 1 );