X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=blobdiff_plain;f=test%2Fdb_reposition.php;fp=test%2Fdb_reposition.php;h=299974d1426531cd23568caf80929170d2728f54;hp=0000000000000000000000000000000000000000;hb=19e2f5c79c22fd1585ca6569ad25e7ecf06ff7f0;hpb=7fb2927d0a3dd3411285f9dc153d50d4bbc9ac6e diff --git a/test/db_reposition.php b/test/db_reposition.php new file mode 100644 index 0000000..299974d --- /dev/null +++ b/test/db_reposition.php @@ -0,0 +1,93 @@ + $from) ? ($to - 1) : ($to), # adjust if moving into the part we moved in the first splice + 0, # don't delete anything + $moving # insert these + ); + + # check if it matches + if (($tests % 10) === 9) { + $db_ids = db_get_column('test_db_reposition', 'id', 'order by ord'); + for ($i = 0; $i < 10; ++$i) { + if ($ids[$i] != $db_ids[$i]) { + message('fail'); + return; + } + } + } + } + message("pass! $max_tests repositions checked every 10"); +}