<?php

declare(strict_types=1);

namespace App\Tests\Unit\Doctrine\OST\AST;

use App\Doctrine\ORM\AST\SphericalDistance;
use Doctrine\ORM\Query\AST\Node;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class TestableSphericalDistance extends SphericalDistance
{
    public function getLongitude1(): Node|string
    {
        return $this->longitude1;
    }

    public function getLongitude2(): Node|string
    {
        return $this->longitude2;
    }

    public function getLatitude1(): Node|string
    {
        return $this->latitude1;
    }

    public function getLatitude2(): Node|string
    {
        return $this->latitude2;
    }
}

class SphericalDistanceTest extends TestCase
{
    protected function getMockFor(string $methodName): TestableSphericalDistance|MockObject
    {
        return $this
            ->getMockBuilder(TestableSphericalDistance::class)
            ->setMethodsExcept([$methodName, 'getLongitude1', 'getLongitude2', 'getLatitude1', 'getLatitude2'])
            ->getMock();
    }

    // TODO: complete if possible (it's hard to test...)
}
