1<?php declare(strict_types=1); 2 3namespace App\Tests\Unit\Utils\Versions; 4 5use PHPUnit\Framework\TestCase; 6use App\Utils\Versions\Client; 7 8class ClientTest extends TestCase 9{ 10 /** @var Client */ 11 private $client; 12 13 public function setUp(): void 14 { 15 $this->client = new Client(); 16 17 $reflection = new \ReflectionClass($this->client); 18 19 $devVersionsUrl = $reflection->getProperty('devVersionsUrl'); 20 $devVersionsUrl->setAccessible(true); 21 $devVersionsUrl->setValue($this->client, TEST_MOCKS_DIRECTORY . '/responses/dev-body.txt'); 22 23 $stableVersionsUrl = $reflection->getProperty('stableVersionsUrl'); 24 $stableVersionsUrl->setAccessible(true); 25 $stableVersionsUrl->setValue($this->client, TEST_MOCKS_DIRECTORY . '/responses/stable-body.txt'); 26 } 27 28 public function testFetchDevVersions(): void 29 { 30 $this->assertIsArray($this->client->fetchDevVersions()); 31 } 32 33 public function testFetchStableVersions(): void 34 { 35 $this->assertIsArray($this->client->fetchStableVersions()); 36 } 37} 38