Passed
Pull Request — master (#63)
by Eugene
02:57
created

ReplaceTest::testReplace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 1
b 0
f 1
1
<?php
2
3
/**
4
 * This file is part of the Tarantool Client package.
5
 *
6
 * (c) Eugene Leonovich <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Tarantool\Client\Tests\Integration\Requests;
15
16
use Tarantool\Client\Schema\Criteria;
17
use Tarantool\Client\Tests\Integration\TestCase;
18
19
/**
20
 * @eval space = create_space('request_replace')
21
 * @eval space:create_index('primary', {type = 'hash', parts = {1, 'unsigned'}})
22
 * @eval space:create_index('secondary', {type = 'tree', parts = {2, 'str'}})
23
 * @eval space:insert{2, 'replace_me'}
24
 */
25
final class ReplaceTest extends TestCase
26
{
27
    public function testReplace() : void
28
    {
29
        $space = $this->client->getSpace('request_replace');
30
31
        self::assertSame([[2, 'replace_me']], $space->select(Criteria::key([2])));
32
        self::assertSame([[2, 'replaced']], $space->replace([2, 'replaced']));
33
    }
34
}
35