Skip to content

Commit 1fa806e

Browse files
committed
Fix tests
1 parent f688bcf commit 1fa806e

File tree

4 files changed

+9
-46
lines changed

4 files changed

+9
-46
lines changed

src/DMLQueryBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function update(
6363
array &$params = []
6464
): string {
6565
if ($from !== null) {
66-
throw new NotSupportedException('Oracle does not support UPDATE with FROM clause.');
66+
throw new NotSupportedException('Oracle does not support FROM clause in UPDATE statement.');
6767
}
6868
return parent::update($table, $columns, $condition, null, $params);
6969
}

tests/CommandTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,10 @@ public function testUpdate(
490490
array $expectedValues,
491491
int $expectedCount,
492492
): void {
493+
if ($from !== null) {
494+
$this->expectException(NotSupportedException::class);
495+
$this->expectExceptionMessage('Oracle does not support FROM clause in UPDATE statement.');
496+
}
493497
parent::testUpdate($table, $columns, $conditions, $from, $params, $expectedValues, $expectedCount);
494498
}
495499

tests/Provider/QueryBuilderProvider.php

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -142,51 +142,6 @@ public static function insert(): array
142142
return $insert;
143143
}
144144

145-
public static function update(): array
146-
{
147-
$data = parent::update();
148-
foreach ($data as $key => $item) {
149-
if ($item[3] !== null) {
150-
unset($data[$key]);
151-
}
152-
}
153-
return array_merge(
154-
$data,
155-
[
156-
[
157-
'{{table}}',
158-
['name' => '{{tmp}}.{{name}}'],
159-
[],
160-
'tmp',
161-
[],
162-
self::replaceQuotes(
163-
<<<SQL
164-
UPDATE [[table]] SET [[name]]=:qp0
165-
SQL
166-
),
167-
[
168-
':qp0' => new Param('{{tmp}}.{{name}}', DataType::STRING),
169-
],
170-
],
171-
[
172-
'{{table}}',
173-
['name' => '{{tmp}}.{{name}}'],
174-
[],
175-
['tmp' => self::getDb()->select()->from('{{tmp}}')],
176-
[],
177-
self::replaceQuotes(
178-
<<<SQL
179-
UPDATE [[table]] SET [[name]]=:qp0
180-
SQL
181-
),
182-
[
183-
':qp0' => new Param('{{tmp}}.{{name}}', DataType::STRING),
184-
],
185-
],
186-
]
187-
);
188-
}
189-
190145
public static function upsert(): array
191146
{
192147
$concreteData = [

tests/QueryBuilderTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,10 @@ public function testUpdate(
482482
string $expectedSql,
483483
array $expectedParams = [],
484484
): void {
485+
if ($from !== null) {
486+
$this->expectException(NotSupportedException::class);
487+
$this->expectExceptionMessage('Oracle does not support FROM clause in UPDATE statement.');
488+
}
485489
parent::testUpdate($table, $columns, $condition, $from, $params, $expectedSql, $expectedParams);
486490
}
487491

0 commit comments

Comments
 (0)