<?php

namespace Tests\Unit\Framework;

use Openguru\OpenCartFramework\Support\PaginationHelper;
use PHPUnit\Framework\TestCase;

class PaginationHelperTest extends TestCase
{
    public function testCalculateLastPageWithExactDivision(): void
    {
        $result = PaginationHelper::calculateLastPage(100, 10);
        $this->assertEquals(10, $result);
    }

    public function testCalculateLastPageWithRemainder(): void
    {
        $result = PaginationHelper::calculateLastPage(101, 10);
        $this->assertEquals(11, $result);
    }

    public function testCalculateLastPageWithSingleRecord(): void
    {
        $result = PaginationHelper::calculateLastPage(1, 10);
        $this->assertEquals(1, $result);
    }

    public function testCalculateLastPageWithZeroRecords(): void
    {
        $result = PaginationHelper::calculateLastPage(0, 10);
        $this->assertEquals(0, $result);
    }

    public function testCalculateLastPageWithLargeNumbers(): void
    {
        $result = PaginationHelper::calculateLastPage(1000, 25);
        $this->assertEquals(40, $result);
    }

    public function testCalculateLastPageWithOnePerPage(): void
    {
        $result = PaginationHelper::calculateLastPage(5, 1);
        $this->assertEquals(5, $result);
    }
}

