<?php

/**
 * This file is part of the Tarantool Client package.
 *
 * (c) Eugene Leonovich <gen.work@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Tarantool\Client\Tests\Unit;

use PHPUnit\Framework\TestCase;
use Tarantool\Client\Response;

final class ResponseTest extends TestCase
{
    public function testHasBodyKeyReturnsTrue() : void
    {
        $response = new Response([], [42 => null]);

        self::assertTrue($response->hasBodyField(42));
    }

    public function testHasBodyKeyReturnsFalse() : void
    {
        $response = new Response([], [24 => null]);

        self::assertFalse($response->hasBodyField(42));
    }
}

<?php

/**
 * This file is part of the Tarantool Client package.
 *
 * (c) Eugene Leonovich <gen.work@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Tarantool\Client\Tests\Unit;

use PHPUnit\Framework\TestCase;
use Tarantool\Client\Keys;
use Tarantool\Client\Response;

final class ResponseTest extends TestCase
{
    public function testGetSchemaIdReturnsCorrectId() : void
    {
        $schemaId = 42;
        $response = new Response([Keys::SCHEMA_ID => $schemaId], []);

        self::assertSame($schemaId, $response->getSchemaId());
    }

    public function testHasBodyKeyReturnsTrue() : void
    {
        $response = new Response([], [42 => null]);

        self::assertTrue($response->hasBodyField(42));
    }

    public function testHasBodyKeyReturnsFalse() : void
    {
        $response = new Response([], [24 => null]);

        self::assertFalse($response->hasBodyField(42));
    }
}

Add a unit test for Respose::getSchemaId()
Add a unit test for Respose::getSchemaId()
