Completed
Pull Request — master (#63)
by Eugene
05:25
created

PackerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provideBadUnpackData() 0 6 1
A setUp() 0 3 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\Unit\Packer;
15
16
use PHPUnit\Framework\TestCase;
17
use Tarantool\Client\Keys;
18
use Tarantool\Client\Packer\Packer;
19
use Tarantool\Client\RequestTypes;
20
21
abstract class PackerTest extends TestCase
22
{
23
    /**
24
     * @var Packer
25
     */
26
    protected $packer;
27
28
    final protected function setUp() : void
29
    {
30
        $this->packer = $this->createPacker();
31
    }
32
33
    public function provideBadUnpackData() : iterable
34
    {
35
        return [
36
            [''],
37
            ["\x82"],
38
            [\pack('C*', 0x82, Keys::CODE, RequestTypes::CALL, Keys::SYNC, 0)."\x82"],
39
        ];
40
    }
41
42
    abstract protected function createPacker() : Packer;
43
}
44