<?php
/**
 * ListReceiptsResponsePageTest
 *
 * PHP version 7.3
 *
 * @category Class
 * @package  FattureInCloud
 * @author   Fatture In Cloud API team
 * @link     https://fattureincloud.it
 */

/**
 * Fatture in Cloud API v2 - API Reference
 *
 * ## Request informations In every request description you will be able to find some additional informations about context, permissions and supported functionality:  | Parameter | Description | |-----------|-------------| | 👥 Context | Indicate the subject of the request. Can be `company`, `user` or `accountant`.  | | 🔒 Required scope | If present, indicates the required scope to fulfill the request. | | 🔍 Filtering | If present, indicates which fields support the filtering feature. | | ↕️ Sorting | If present, indicates which fields support the sorting feature. | | 📄 Paginated results | If present, indicate that the results are paginated. | | 🎩 Customized responses supported | If present, indicate that you can use `field` or `fieldset` to customize the response body. |  For example the request `GET /entities/{entityRole}` have tis informations: \\ 👥 Company context \\ 🔒 Required scope: `entity.clients:r` or `entity.suppliers:r` (depending on `entityRole`) \\ 🔍 Filtering: `id`, `name` \\ ↕️ Sorting: `id`, `name` \\ 📄 Paginated results \\ 🎩 Customized responses supported  Keep in mind that if you are making **company realted requests**, you will need to specify the company id in the requests: ``` GET /c/{company_id}/issued_documents ```
 *
 * The version of the OpenAPI document: 2.0.6
 * Contact: info@fattureincloud.it
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 5.3.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Please update the test case below to test the model.
 */

namespace FattureInCloud\Test\Model;

use PHPUnit\Framework\TestCase;
use \FattureInCloud\ObjectSerializer;

/**
 * ListReceiptsResponsePageTest Class Doc Comment
 *
 * @category    Class
 * @description ListReceiptsResponsePage
 * @package     FattureInCloud
 * @author   Fatture In Cloud API team
 * @link     https://fattureincloud.it
 */
class ListReceiptsResponsePageTest extends TestCase
{
    public $array = [];
    public $object;

    /**
     * Setup before running any test case
     */
    public static function setUpBeforeClass(): void
    {
    }

    /**
     * Setup before running each test case
     */
    public function setUp(): void
    {
        $json = '{
            "data": [
                {
                  "id": 12345,
                  "date": "2021-08-20",
                  "number": 5,
                  "numeration": "REC005",
                  "amount_net": 16.39,
                  "amount_vat": 3.61,
                  "amount_gross": 20,
                  "use_gross_prices": true,
                  "type": "sales_receipt",
                  "description": "cassa 1",
                  "rc_center": "",
                  "created_at": "2021-08-20 13:56:56",
                  "updated_at": "2021-08-20 13:56:56",
                  "payment_account": {
                    "id": 222,
                    "name": "carta di credito"
                  },
                  "items_list": [
                    {
                      "id": 666,
                      "amount_net": 10,
                      "amount_vat": 2.2,
                      "amount_gross": 12.2,
                      "category": "altro",
                      "vat": {
                        "id": 0,
                        "value": 22,
                        "description": "iva"
                      }
                    },
                    {
                      "id": 777,
                      "amount_net": 100,
                      "amount_vat": 4,
                      "amount_gross": 104,
                      "category": "altro",
                      "vat": {
                        "id": 0,
                        "value": 22,
                        "description": "iva"
                      }
                    }
                  ]
                },
                {
                  "id": 12346,
                  "date": "2021-08-19",
                  "number": 6,
                  "numeration": "REC006",
                  "amount_net": 8.2,
                  "amount_vat": 1.8,
                  "amount_gross": 10,
                  "use_gross_prices": true,
                  "type": "sales_receipt",
                  "description": "cassa 1",
                  "rc_center": "",
                  "created_at": "2021-08-19 17:57:56",
                  "updated_at": "2021-08-19 17:57:56",
                  "payment_account": {
                    "id": 555,
                    "name": "contanti"
                  },
                  "items_list": [
                    {
                      "id": 888,
                      "amount_net": 8.2,
                      "amount_vat": 1.8,
                      "amount_gross": 10,
                      "category": "altro",
                      "vat": {
                        "id": 0,
                        "value": 22,
                        "description": "iva"
                      }
                    }
                  ]
                }
              ]
        }';

        $this->array = json_decode($json, true);

        $this->object = ObjectSerializer::deserialize($json, '\FattureInCloud\Model\ListReceiptsResponsePage');
    }

    /**
     * Clean up after running each test case
     */
    public function tearDown(): void
    {
    }

    /**
     * Clean up after running all test cases
     */
    public static function tearDownAfterClass(): void
    {
    }

    /**
     * Test "ListReceiptsResponsePage"
     */
    public function testListReceiptsResponsePage()
    {
        foreach ($this->array as $key => $value) {
            Testcase::assertArrayHasKey($key, $this->object);
        }
    }

    /**
     * Test attribute "data"
     */
    public function testPropertyData()
    {
        foreach ($this->array['data'] as $key => $value) {
            Testcase::assertArrayHasKey($key, $this->object['data']);
        }
    }
}
