X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fgabordemooij%2Fredbean%2Ftesting%2FRedUNIT%2FBase%2FNamedparams.php;fp=vendor%2Fgabordemooij%2Fredbean%2Ftesting%2FRedUNIT%2FBase%2FNamedparams.php;h=0000000000000000000000000000000000000000;hp=95d4b313783f9d8b203a9242423fce3ac659be57;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Namedparams.php b/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Namedparams.php deleted file mode 100644 index 95d4b3137..000000000 --- a/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Namedparams.php +++ /dev/null @@ -1,103 +0,0 @@ -title = 'book'; - $book->sharedPage[] = $page; - R::store($book); - //should not give error like: Uncaught [HY093] - SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters - $books = $page->withCondition(' title = :title ', array( ':title' => 'book' ) )->sharedBook; - asrt( count( $books ), 1 ); - //should not give error... - $books = $page->withCondition( ' title = :title ', array( ':title' => 'book' ) )->sharedBook; - asrt( count( $books ), 1 ); - R::nuke(); - $book = R::dispense( 'book' ); - $page = R::dispense( 'page' ); - $book->title = 'book'; - $book->comment = 'comment'; - $page->title = 'page'; - $book->ownPage[] = $page; - R::store( $book ); - //should also not give error.. - $count = $book->countOwn( 'page' ); - asrt( $count, 1 ); - $book = $book->fresh(); - //should also not give error.. - $count = $book->withCondition( ' title = ? ', array( 'page' ) )->countOwn( 'page' ); - asrt( $count, 1 ); - $book = $book->fresh(); - //should also not give error.. - $count = $book->withCondition( ' title = :title ', array( ':title' => 'page' ) )->countOwn( 'page' ); - asrt( $count, 1 ); - $book = $book->fresh(); - $pages = $book->withCondition( ' title = :title ', array( ':title' => 'page' ) )->ownPage; - asrt( count( $pages ), 1 ); - //test with duplicate slots... - $page = reset( $pages ); - $page2 = R::dispense( 'page' ); - $page2->ownPage[] = $page; - R::store( $page2 ); - $page2 = $page2->fresh(); - $pages = $page2->withCondition( ' title = :title ', array( ':title' => 'page' ) )->ownPage; - asrt( count( $pages ), 1 ); - //test with find() - $books = R::getRedBean()->find( 'book', - array( - 'title' => array('book')), - ' AND title = :title ', array(':title'=>'book')); - asrt( count( $books ), 1 ); - $books = R::getRedBean()->find( 'book', - array( - 'title' => array('book', 'book2'), - 'comment' => array('comment', 'comment2')), - ' AND title = :title ', array(':title'=>'book')); - asrt( count( $books ), 1 ); - //just check numeric works as well... - $books = R::getRedBean()->find( 'book', - array( - 'title' => array('book', 'book2'), - 'comment' => array('comment', 'comment2')), - ' AND title = ? ', array('book')); - asrt( count( $books ), 1 ); - //just extra check to verify glue works - $books = R::getRedBean()->find( 'book', - array( - 'title' => array('book', 'book2'), - 'comment' => array('comment', 'comment2')), - ' ORDER BY id '); - asrt( count( $books ), 1 ); - } -}