diff --git a/src/Query/Builder.php b/src/Query/Builder.php index 27cfd8ac..591d6dc8 100644 --- a/src/Query/Builder.php +++ b/src/Query/Builder.php @@ -453,6 +453,48 @@ public function whereIn($column, $values, $boolean = 'and', $not = false) return $this; } + public function whereIntegerInRaw($column, $values, $boolean = 'and', $not = false) + { + return $this->whereIn($column, $values, $boolean, $not); + } + + /** + * Add an "or where in raw" clause for integer values to the query. + * + * @param string $column + * @param \Illuminate\Contracts\Support\Arrayable|array $values + * @return $this + */ + public function orWhereIntegerInRaw($column, $values) + { + return $this->whereIntegerInRaw($column, $values, 'or'); + } + + /** + * Add a "where not in raw" clause for integer values to the query. + * + * @param string $column + * @param \Illuminate\Contracts\Support\Arrayable|array $values + * @param string $boolean + * @return $this + */ + public function whereIntegerNotInRaw($column, $values, $boolean = 'and') + { + return $this->whereIntegerInRaw($column, $values, $boolean, true); + } + + /** + * Add an "or where not in raw" clause for integer values to the query. + * + * @param string $column + * @param \Illuminate\Contracts\Support\Arrayable|array $values + * @return $this + */ + public function orWhereIntegerNotInRaw($column, $values) + { + return $this->whereIntegerNotInRaw($column, $values, 'or'); + } + /** * Add a where between statement to the query. * diff --git a/tests/TestCase.php b/tests/TestCase.php index e91b2f94..a746fdb0 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -13,9 +13,9 @@ class Stub extends Model class TestCase extends PHPUnit { - public function __construct() + public function __construct(?string $name = null, array $data = [], $dataName = '') { - parent::__construct(); + parent::__construct($name, $data, $dataName); // load custom configuration file $this->dbConfig = require 'config/database.php'; diff --git a/tests/Vinelab/NeoEloquent/Eloquent/BuilderTest.php b/tests/Vinelab/NeoEloquent/Eloquent/BuilderTest.php index ac3bb595..b2e90226 100644 --- a/tests/Vinelab/NeoEloquent/Eloquent/BuilderTest.php +++ b/tests/Vinelab/NeoEloquent/Eloquent/BuilderTest.php @@ -79,7 +79,7 @@ public function testFindWithMany() $builder->setModel($this->getMockModel()); $builder->shouldReceive('get')->with(['column'])->andReturn('baz'); - $result = $builder->find([1, 2], ['column']); + $result = $builder->findMany([1, 2], ['column']); $this->assertEquals('baz', $result); }