<?php

declare(strict_types=1);

namespace Tests\Integration\Services;

use Tests\TestCase;

class ProductsServiceTest extends TestCase
{
    protected function setUp(): void
    {
        parent::setUp();
    }

    protected function tearDown(): void
    {
        parent::tearDown();
    }

    /** @test */
    public function returns_paginated_products(): void
    {
        $this->markTestSkipped('Requires OpenCart Registry and Currency classes');
        
        $result = $this->service->getProductsResponse([
            'page' => 1,
            'perPage' => 6,
            'search' => '',
            'filters' => null,
        ], 1);

        $this->assertIsArray($result);
        $this->assertArrayHasKey('data', $result);
        $this->assertArrayHasKey('meta', $result);
        $this->assertIsArray($result['data']);
    }

    /** @test */
    public function returns_products_with_search_query(): void
    {
        $this->markTestSkipped('Requires OpenCart Registry and Currency classes');
    }

    /** @test */
    public function throws_exception_for_invalid_product_id(): void
    {
        $this->markTestSkipped('Requires OpenCart Registry');
        
        $this->expectException(EntityNotFoundException::class);

        $this->service->getProductById(999999);
    }

    /** @test */
    public function returns_product_with_valid_id(): void
    {
        $this->markTestSkipped('Requires OpenCart Registry');
    }

    /** @test */
    public function escapes_html_in_product_names(): void
    {
        $this->markTestSkipped('Requires OpenCart Registry');
    }

    /** @test */
    public function handles_search_with_special_characters(): void
    {
        $this->markTestSkipped('Requires OpenCart Registry');
    }
}

