Files
FOSSBilling/tests/Modules/Product/GuestTest.php
T
FOSSBilling BotandFOSSBilling Bot db8ed5f4d8 Apply PHP Code Styling & Quality Changes (#2126)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2024-02-08 16:25:53 -08:00

33 lines
982 B
PHP

<?php
declare(strict_types=1);
namespace ProductTests;
use APIHelper\Request;
use PHPUnit\Framework\TestCase;
final class GuestTest extends TestCase
{
public function testGetList()
{
$result = Request::makeRequest('guest/product/get_list');
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
$this->assertIsArray($result->getResult());
}
public function testGetPairs()
{
$result = Request::makeRequest('guest/product/get_pairs');
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
$this->assertIsArray($result->getResult());
}
public function testGetMissingRequiredParams()
{
$result = Request::makeRequest('guest/product/get');
$this->assertFalse($result->wasSuccessful(), 'The request succeeded when it should not have');
$this->assertEquals('Product ID or slug is missing', $result->getErrorMessage());
}
}