Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* add GroupByDialectCriteriaTest #54

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions main/Net/Http/HeaderUtils.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -122,9 +123,7 @@ public static function sendNotCachedHeader()
public static function sendContentLength($length)
{
Assert::isInteger($length);

header("Content-Length: {$length}");

self::$headerSent = true;
}

Expand Down
44 changes: 44 additions & 0 deletions test/main/GroupByDialectCriteriaTest.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/* $Id$ */

final class GroupByDialectCriteriaTest extends TestCase
{
public function testMyDialect()
{
$criteria =
Criteria::create(TestUser::dao())->
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`'
);

}
}
?>