db backup prior to drupal security update
[yaffs-website] / vendor / gabordemooij / redbean / testing / RedUNIT / Base / Largenum.php
1 <?php
2
3 namespace RedUNIT\Base;
4
5 use RedUNIT\Base as Base;
6 use RedBeanPHP\Facade as R;
7
8 /**
9  * Large Number Limit Test (issue #386)
10  *
11  * Tests whether we can use large numbers for limit clause.
12  *
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
17  *
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.
21  */
22 class Largenum extends Base
23 {
24         /**
25          * Test for issue #386.
26          * Can we use large numbers in LIMIT ?
27          *
28          * @return void
29          */
30         public function testLargeNum()
31         {
32                 if ( defined( 'HHVM_VERSION' ) ) return; //oops hhvm has incorrect binding for large nums.
33                 $number = R::dispense( 'number' );
34                 $number->name = 'big number';
35                 R::store( $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 );
40                 pass();
41         }
42 }