Skip to content

Commit

Permalink
Do not incorrectly include orderBy as values in delete statements
Browse files Browse the repository at this point in the history
orderBy is rendered in AdvancedStatement::renderOrderBy without placeholders
  • Loading branch information
bnf committed Jan 22, 2023
1 parent 891d066 commit 8f122ba
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 0 additions & 4 deletions src/Statement/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ public function getValues(): array
$values = array_merge($values, $this->where->getValues());
}

if (!empty($this->orderBy)) {
$values = array_merge($values, $this->orderBy);
}

if ($this->limit != null) {
$values = array_merge($values, $this->limit->getValues());
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Statement/DeleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,8 @@ public function testGetValuesWithOrderBy()
->orderBy('id', 'ASC')
->orderBy('name', 'DESC');

// FIXME This seems broken...
$this->assertIsArray($this->subject->getValues());
$this->assertCount(2, $this->subject->getValues());
$this->assertCount(0, $this->subject->getValues());
}

public function testGetValuesWithLimit()
Expand Down

0 comments on commit 8f122ba

Please sign in to comment.