diff --git a/main/Net/Http/HeaderUtils.class.php b/main/Net/Http/HeaderUtils.class.php index 07ec0bac6e..260dae1822 100644 --- a/main/Net/Http/HeaderUtils.class.php +++ b/main/Net/Http/HeaderUtils.class.php @@ -36,8 +36,9 @@ public static function redirectBack() self::$headerSent = true; self::$redirectSent = true; return $_SERVER['HTTP_REFERER']; - } else - return false; + } + + return false; } public static function getRequestHeaderList() @@ -122,9 +123,7 @@ public static function sendNotCachedHeader() public static function sendContentLength($length) { Assert::isInteger($length); - header("Content-Length: {$length}"); - self::$headerSent = true; } diff --git a/test/main/GroupByDialectCriteriaTest.class.php b/test/main/GroupByDialectCriteriaTest.class.php new file mode 100644 index 0000000000..4e06befb36 --- /dev/null +++ b/test/main/GroupByDialectCriteriaTest.class.php @@ -0,0 +1,44 @@ + + addProjection( + Projection::property( + SQLFunction::create( + 'date', 'strangeTime' + ), + + 'st' + ) + )-> + addProjection( + Projection::group('st') + ); + + $this->assertEquals( + $criteria->toDialectString(MyDialect::me()), + 'SELECT date(`test_user`.`strange_time`) AS `st` FROM `test_user` GROUP BY `st`' + ); + + $criteria = + Criteria::create(TestUser::dao())-> + addProjection( + Projection::property('strangeTime', 'st') + )-> + addProjection( + Projection::group('st') + ); + + $this->assertEquals( + $criteria->toDialectString(MyDialect::me()), + 'SELECT `strange_time` AS `st` FROM `test_user` GROUP BY `st`' + ); + + } + } +?>