Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

More having tests #475

Merged
merged 1 commit into from

2 participants

@philsturgeon

This shows that having works without group by (nobody on IRC today seemed to think that was a thing) and tests that aliases work as expected - which they dont seem to be in reality.

@philsturgeon philsturgeon More having tests
This shows that having works without group by (nobody on IRC today seemed to think that was a thing) and tests that aliases work as expected - which they dont seem to be in reality.
2e63351
@daylerees

Thanks to be havings these tests!

@daylerees daylerees merged commit f6dac9e into laravel:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 1, 2013
  1. @philsturgeon

    More having tests

    philsturgeon authored
    This shows that having works without group by (nobody on IRC today seemed to think that was a thing) and tests that aliases work as expected - which they dont seem to be in reality.
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 1 deletion.
  1. +9 −1 tests/Database/DatabaseQueryBuilderTest.php
View
10 tests/Database/DatabaseQueryBuilderTest.php
@@ -192,8 +192,16 @@ public function testOrderBys()
public function testHavings()
{
$builder = $this->getBuilder();
+ $builder->select('*')->from('users')->having('email', '>', 1);
+ $this->assertEquals('select * from "users" having "email" > ?', $builder->toSql());
+
+ $builder = $this->getBuilder();
$builder->select('*')->from('users')->groupBy('email')->having('email', '>', 1);
$this->assertEquals('select * from "users" group by "email" having "email" > ?', $builder->toSql());
+
+ $builder = $this->getBuilder();
+ $builder->select('email as foo_email')->from('users')->having('foo_email', '>', 1);
+ $this->assertEquals('select "email" as "foo_email" from "users" having "foo_email" > ?', $builder->toSql());
}
@@ -630,4 +638,4 @@ protected function getSqlServerBuilder()
return new Builder(m::mock('Illuminate\Database\ConnectionInterface'), $grammar, $processor);
}
-}
+}
Something went wrong with that request. Please try again.