X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fgabordemooij%2Fredbean%2Ftesting%2FRedUNIT%2FBase%2FCursors.php;fp=vendor%2Fgabordemooij%2Fredbean%2Ftesting%2FRedUNIT%2FBase%2FCursors.php;h=0000000000000000000000000000000000000000;hp=a74a8b56922a6748c9ce4c6c48b0c1ec0031f48d;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Cursors.php b/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Cursors.php deleted file mode 100644 index a74a8b569..000000000 --- a/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Cursors.php +++ /dev/null @@ -1,95 +0,0 @@ -number = $i; - $page->content = sha1( $i ); - R::store( $page ); - } - $collection = R::findCollection( 'page' ); - asrt( get_class( $collection ), 'RedBeanPHP\BeanCollection'); - $i = 0; - $list = array(); - while( $bean = $collection->next() ) { - asrt( ( $bean instanceof OODBBean ), TRUE ); - asrt( (string) $bean->number, strval( $i ) ); - asrt( $bean->content, sha1( $i ) ); - $list[] = $bean->content; - $i ++; - } - $collection = R::findCollection( 'page', ' ORDER BY content ASC ' ); - sort( $list ); - $i = 0; - while( $bean = $collection->next() ) { - asrt( $bean->content, $list[$i] ); - $i ++; - } - $collection = R::findCollection( 'page', ' ORDER BY content ASC LIMIT 5 ' ); - sort( $list ); - $i = 0; - while( $bean = $collection->next() ) { - asrt( $bean->content, $list[$i] ); - $i ++; - if ( $i > 5 ) break; - } - $key = array_rand( $list ); - $content = $list[ $key ]; - $collection = R::findCollection( 'page', ' content = ? ', array( $content ) ); - $bean = $collection->next(); - asrt( $bean->content, $content ); - $collection->close(); - } - - /** - * Test empty collections (NULLCursor). - * - * @return void - */ - public function testEmptyCollection() - { - R::nuke(); - $page = R::dispense( 'page' ); - $page->content = 'aaa'; - R::store( $page ); - $collection = R::findCollection( 'page' ); - asrt( get_class( $collection ), 'RedBeanPHP\BeanCollection'); - $collection = R::findCollection( 'page', ' content = ?', array( 'bbb' ) ); - asrt( get_class( $collection ), 'RedBeanPHP\BeanCollection'); - asrt( is_null( $collection->next() ), TRUE ); - $collection = R::findCollection( 'something' ); - asrt( get_class( $collection ), 'RedBeanPHP\BeanCollection'); - asrt( is_null( $collection->next() ), TRUE ); - $collection->close(); - } -}