Skip to content

Commit

Permalink
Merge pull request #60 from efcor/patch-5
Browse files Browse the repository at this point in the history
fix failing test
  • Loading branch information
jfelder authored Feb 12, 2021
2 parents a644670 + ffc8ac4 commit 28f5dba
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/OracleDBQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,24 +290,29 @@ public function testBasicWheres()
public function testWheresWithArrayValue()
{
$builder = $this->getOracleBuilder();
$builder->select('*')->from('users')->where('id', [12, 30]);
$builder->select('*')->from('users')->where('id', [12]);
$this->assertSame('select * from "users" where "id" = ?', $builder->toSql());
$this->assertEquals([0 => 12, 1 => 30], $builder->getBindings());
$this->assertEquals([0 => 12], $builder->getBindings());

$builder = $this->getOracleBuilder();
$builder->select('*')->from('users')->where('id', '=', [12, 30]);
$this->assertSame('select * from "users" where "id" = ?', $builder->toSql());
$this->assertEquals([0 => 12, 1 => 30], $builder->getBindings());
$this->assertEquals([0 => 12], $builder->getBindings());

$builder = $this->getOracleBuilder();
$builder->select('*')->from('users')->where('id', '!=', [12, 30]);
$this->assertSame('select * from "users" where "id" != ?', $builder->toSql());
$this->assertEquals([0 => 12, 1 => 30], $builder->getBindings());
$this->assertEquals([0 => 12], $builder->getBindings());

$builder = $this->getOracleBuilder();
$builder->select('*')->from('users')->where('id', '<>', [12, 30]);
$this->assertSame('select * from "users" where "id" <> ?', $builder->toSql());
$this->assertEquals([0 => 12, 1 => 30], $builder->getBindings());
$this->assertEquals([0 => 12], $builder->getBindings());

$builder = $this->getOracleBuilder();
$builder->select('*')->from('users')->where('id', '=', [[12, 30]]);
$this->assertSame('select * from "users" where "id" = ?', $builder->toSql());
$this->assertEquals([0 => 12], $builder->getBindings());
}

public function testDateBasedWheresAcceptsTwoArguments()
Expand Down

0 comments on commit 28f5dba

Please sign in to comment.