Skip to content

Commit

Permalink
Increased test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
masterWeber committed Jan 7, 2021
1 parent 158ebf0 commit bb8d42f
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Clause/Condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
use SQLBuilder\Operator\Operator;
use SQLBuilder\Stringable_;

class Condition implements Stringable_
class Condition extends Expression implements Stringable_
{
protected ?Stringable_ $parent;
protected array $expressions;
Expand Down Expand Up @@ -215,7 +215,7 @@ protected function buildExpressions(): string
}

if ($expression instanceof Expression) {
$str .= $expression->__toString();
$str .= $expression;
} elseif (is_string($expression)) {
$str .= $expression;
} else {
Expand Down
4 changes: 0 additions & 4 deletions src/Clause/OrderBy.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ public function __construct($expression, $sorting = self::ASC, Stringable_ $pare

public function __toString(): string
{
if (empty($this->expressionList)) {
return '';
}

$str = '';
foreach ($this->expressionList as $orderBy) {
$str .= ', ' . Helper::quoteColumn($orderBy[0]);
Expand Down
4 changes: 0 additions & 4 deletions src/Expression/Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@

abstract class Expression implements Stringable_
{
public function __toString(): string
{
return '';
}
}
4 changes: 0 additions & 4 deletions src/Operator/Operator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@

abstract class Operator implements Stringable_
{
public function __toString(): string
{
return '';
}
}
2 changes: 1 addition & 1 deletion tests/Clause/OrderByTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function testToString()

$orderBy = new OrderBy([
'col_name' => OrderBy::DESC,
'col_name_1' => OrderBy::ASC,
'col_name_1',
]);

$this->assertEquals(
Expand Down
1 change: 0 additions & 1 deletion tests/SqlBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public function testDelete(): void
->from('table_name')
->where()
->equal('col1', 2)
->and()
->equal('col2', 23)
->limit(3);

Expand Down

0 comments on commit bb8d42f

Please sign in to comment.