File tree Expand file tree Collapse file tree 4 files changed +33
-0
lines changed
tests/unit/Repositories/MySql/Sorts Expand file tree Collapse file tree 4 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 11# Change Log
22
3+ ### 1.8.8
4+
5+ * Fixed: Custom sorts now invalidate collections
6+ * Added: MySqlRandom Sort
7+
38### 1.8.7
49
510* Fixed: Added value inspection to determine type when unit testing and no column
Original file line number Diff line number Diff line change @@ -363,6 +363,7 @@ final public function replaceCustomSort(Sort $sort)
363363 final public function addCustomSort (Sort $ sort )
364364 {
365365 $ this ->sorts [] = $ sort ;
366+ $ this ->invalidate ();
366367 }
367368
368369 /**
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rhubarb \Stem \Repositories \MySql \Sorts ;
4+
5+ use Rhubarb \Stem \Collections \Sort ;
6+ use Rhubarb \Stem \Sql \ExpressesSqlInterface ;
7+
8+ class MySqlRandom extends Sort implements ExpressesSqlInterface {
9+ public function getSqlExpression ()
10+ {
11+ return 'RAND() ' ;
12+ }
13+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rhubarb \Stem \Tests \unit \Repositories \MySql \Sorts ;
4+
5+ use Rhubarb \Crown \Tests \Fixtures \TestCases \RhubarbTestCase ;
6+ use Rhubarb \Stem \Repositories \MySql \Sorts \MySqlRandom ;
7+
8+ class MySqlRandomTest extends RhubarbTestCase
9+ {
10+ public function testCustomSortSQL ()
11+ {
12+ $ this ->assertEquals ('RAND() ' , (new MySqlRandom ())->getSqlExpression ());
13+ }
14+ }
You can’t perform that action at this time.
0 commit comments