Skip to content

Commit 53cb89e

Browse files
authored
Merge pull request #34 from MekDrop/improved-column-in-tests
Improved column in tests
2 parents c16962d + ce1ed3a commit 53cb89e

File tree

5 files changed

+11
-21
lines changed

5 files changed

+11
-21
lines changed

src/CriteriaCompo.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Exception;
66
use Imponeer\Database\Criteria\Enum\Condition;
77
use IteratorAggregate;
8-
use Stringable;
98
use Traversable;
109

1110
/**
@@ -109,12 +108,4 @@ public function render(bool $withBindVariables = false): ?string
109108

110109
return $ret;
111110
}
112-
113-
/**
114-
* @throws Exception
115-
*/
116-
public function __toString(): string
117-
{
118-
return $this->render() . 'A';
119-
}
120111
}

src/CriteriaElement.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Imponeer\Database\Criteria;
44

5+
use Exception;
56
use Imponeer\Database\Criteria\Traits\GroupByTrait;
67
use Imponeer\Database\Criteria\Traits\OrderByTrait;
78
use Imponeer\Database\Criteria\Traits\PartialResultsTrait;
@@ -89,4 +90,12 @@ public function __isset(string $name): bool
8990
default => false,
9091
};
9192
}
93+
94+
/**
95+
* @throws Exception
96+
*/
97+
public function __toString(): string
98+
{
99+
return $this->render(true) ?? '';
100+
}
92101
}

src/CriteriaItem.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,4 @@ private function isEmptyArrayButNotNullComparison(mixed $value): bool
232232
ComparisonOperator::NOT_BETWEEN,
233233
], true);
234234
}
235-
236-
/**
237-
* @throws JsonException
238-
*/
239-
public function __toString(): string
240-
{
241-
return $this->render();
242-
}
243235
}

src/Traits/PartialResultsTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function setLimit(int $limit = 0): self
4040
* Gets from what record number to return results (counting starts from 0)
4141
*
4242
* @noinspection MethodShouldBeFinalInspection
43-
* @noinspection PhpDocSignatureInspection
4443
*/
4544
public function getStart(): int
4645
{
@@ -53,7 +52,6 @@ public function getStart(): int
5352
* @param int $start Sets start position
5453
*
5554
* @noinspection MethodShouldBeFinalInspection
56-
* @noinspection PhpDocSignatureInspection
5755
*/
5856
public function setStart(int $start = 0): self
5957
{

tests/CriteriaItemTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ class CriteriaItemTest extends TestCase
1919
* Gets all possible comparison operators enums
2020
*
2121
* @return array<string, array{0: string, 1: mixed, 2: ComparisonOperator|string}>
22-
* @throws RandomException
22+
*
2323
* @throws JsonException
2424
*/
2525
final public static function provideComparisonOperators(): array
2626
{
2727
$faker = Factory::create();
2828

29-
$column = $faker->sha1();
29+
$column = 'field_' . $faker->word();
3030
$specialOperators = [
3131
ComparisonOperator::BETWEEN->name,
3232
ComparisonOperator::NOT_BETWEEN->name,

0 commit comments

Comments
 (0)