X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fgabordemooij%2Fredbean%2Ftesting%2FRedUNIT%2FBlackhole%2FGlue.php;fp=vendor%2Fgabordemooij%2Fredbean%2Ftesting%2FRedUNIT%2FBlackhole%2FGlue.php;h=d0845e0e63e29776106ff18144bca841f6c5a75b;hp=0000000000000000000000000000000000000000;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Glue.php b/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Glue.php new file mode 100644 index 000000000..d0845e0e6 --- /dev/null +++ b/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Glue.php @@ -0,0 +1,63 @@ +glueSQLCondition( ' name = ? '), ' WHERE name = ? ' ); + asrt( $writer->glueSQLCondition( ' value1 > ? OR value < ? '), ' WHERE value1 > ? OR value < ? ' ); + //Does it recognize NON-WHERE conditions? - usual suspects + asrt( $writer->glueSQLCondition( ' ORDER BY name '), ' ORDER BY name ' ); + asrt( $writer->glueSQLCondition( ' LIMIT 10 '), ' LIMIT 10 ' ); + asrt( $writer->glueSQLCondition( ' OFFSET 20 '), ' OFFSET 20 ' ); + //highly doubtful but who knows... - I think nobody will ever use this in a query snippet. + asrt( $writer->glueSQLCondition( ' GROUP BY grp '), ' GROUP BY grp ' ); + asrt( $writer->glueSQLCondition( ' HAVING x = ? '), ' HAVING x = ? ' ); + //can we replace WHERE with AND ? + asrt( $writer->glueSQLCondition( ' AND name = ? ', QueryWriter::C_GLUE_WHERE ), ' WHERE name = ? ' ); + //can we glue with AND instead of WHERE ? + asrt( $writer->glueSQLCondition( ' value1 > ? OR value < ? ', QueryWriter::C_GLUE_AND ), ' AND value1 > ? OR value < ? ' ); + //non-cases + asrt( $writer->glueSQLCondition( ' GROUP BY grp ', QueryWriter::C_GLUE_WHERE ), ' GROUP BY grp ' ); + asrt( $writer->glueSQLCondition( ' GROUP BY grp ', QueryWriter::C_GLUE_AND ), ' GROUP BY grp ' ); + } +}