mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 21:22:40 +00:00
Restore coverage for Query class
This commit is contained in:
parent
a44fe103d8
commit
c6cc2a1a42
2 changed files with 7 additions and 4 deletions
|
@ -16,7 +16,7 @@ class QueryFilter {
|
||||||
|
|
||||||
public $filterRestrictive = true;
|
public $filterRestrictive = true;
|
||||||
|
|
||||||
public function setWhere(string $where, $types = null, $values = null): self {
|
public function setWhere(string $where, $types = null, $values = null): static {
|
||||||
$this->qWhere[] = $where;
|
$this->qWhere[] = $where;
|
||||||
if (!is_null($types)) {
|
if (!is_null($types)) {
|
||||||
$this->tWhere[] = $types ?? [];
|
$this->tWhere[] = $types ?? [];
|
||||||
|
@ -25,7 +25,7 @@ class QueryFilter {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setWhereNot(string $where, $types = null, $values = null): self {
|
public function setWhereNot(string $where, $types = null, $values = null): static {
|
||||||
$this->qWhereNot[] = $where;
|
$this->qWhereNot[] = $where;
|
||||||
if (!is_null($types)) {
|
if (!is_null($types)) {
|
||||||
$this->tWhereNot[] = $types;
|
$this->tWhereNot[] = $types;
|
||||||
|
@ -34,7 +34,7 @@ class QueryFilter {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setFilter(self $filter): self {
|
public function setFilter(self $filter): static {
|
||||||
$this->qWhere[] = "(".$filter->buildWhereBody().")";
|
$this->qWhere[] = "(".$filter->buildWhereBody().")";
|
||||||
$this->tWhere[] = $filter->getWhereTypes();
|
$this->tWhere[] = $filter->getWhereTypes();
|
||||||
$this->vWhere[] = $filter->getWhereValues();
|
$this->vWhere[] = $filter->getWhereValues();
|
||||||
|
|
|
@ -8,7 +8,10 @@ namespace JKingWeb\Arsse\TestCase\Misc;
|
||||||
|
|
||||||
use JKingWeb\Arsse\Misc\Query;
|
use JKingWeb\Arsse\Misc\Query;
|
||||||
|
|
||||||
/** @covers \JKingWeb\Arsse\Misc\Query */
|
/**
|
||||||
|
* @covers \JKingWeb\Arsse\Misc\Query
|
||||||
|
* @covers \JKingWeb\Arsse\Misc\QueryFilter
|
||||||
|
*/
|
||||||
class TestQuery extends \JKingWeb\Arsse\Test\AbstractTest {
|
class TestQuery extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
public function testBasicQuery(): void {
|
public function testBasicQuery(): void {
|
||||||
$q = new Query("select * from table where a = ?", "int", 3);
|
$q = new Query("select * from table where a = ?", "int", 3);
|
||||||
|
|
Loading…
Reference in a new issue