Passed
Branch add-rector-actions (5668b1)
by Wilmer
03:26
created

DummyActiveRecordTest::testUpdateAllException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 8
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\ActiveRecord\Tests;
6
7
use Yiisoft\ActiveRecord\Tests\Stubs\DummyActiveRecord;
8
use Yiisoft\Db\Exception\NotSupportedException;
9
10
/**
11
 * @group main
12
 */
13
final class DummyActiveRecordTest extends TestCase
14
{
15
    public function testUpdateAllException(): void
16
    {
17
        $dummyClass = new DummyActiveRecord($this->sqliteConnection);
18
19
        $this->expectException(NotSupportedException::class);
20
        $this->expectExceptionMessage('Yiisoft\ActiveRecord\BaseActiveRecord::updateAll is not supported.');
21
22
        $dummyClass->updateAll(['id' => 1]);
23
    }
24
25
    public function testUpdateAllCountersException(): void
26
    {
27
        $dummyClass = new DummyActiveRecord($this->sqliteConnection);
28
29
        $this->expectException(NotSupportedException::class);
30
        $this->expectExceptionMessage('Yiisoft\ActiveRecord\BaseActiveRecord::updateAllCounters is not supported');
31
32
        $dummyClass->updateAllCounters(['id' => 1]);
33
    }
34
35
    public function testDeleteAllException(): void
36
    {
37
        $dummyClass = new DummyActiveRecord($this->sqliteConnection);
38
39
        $this->expectException(NotSupportedException::class);
40
        $this->expectExceptionMessage('Yiisoft\ActiveRecord\BaseActiveRecord::deleteAll is not supported.');
41
42
        $dummyClass->deleteAll(['id' => 1]);
43
    }
44
}
45