| Total Complexity | 2 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | use ElevenLabs\Api\Service\ApiServiceBuilder; |
||
| 10 | use PHPUnit\Framework\TestCase; |
||
| 11 | use Psr\Cache\CacheItemInterface; |
||
| 12 | use Psr\Cache\CacheItemPoolInterface; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Class ApiServiceBuilderTest. |
||
| 16 | */ |
||
| 17 | class ApiServiceBuilderTest extends TestCase |
||
| 18 | { |
||
| 19 | /** @test */ |
||
| 20 | public function itShouldBuildAnApiService() |
||
| 26 | } |
||
| 27 | |||
| 28 | /** @test */ |
||
| 29 | public function itShouldBuildAnApiServiceFromCache() |
||
| 30 | { |
||
| 31 | $schemaFile = 'file://fake-schema.yml'; |
||
| 32 | |||
| 33 | $schema = $this->prophesize(Schema::class); |
||
| 34 | $schema->getSchemes()->willReturn(['https']); |
||
| 35 | $schema->getHost()->willReturn('domain.tld'); |
||
| 36 | |||
| 37 | $item = $this->prophesize(CacheItemInterface::class); |
||
| 38 | $item->isHit()->shouldBeCalled()->willReturn(true); |
||
| 39 | $item->get()->shouldBeCalled()->willReturn($schema); |
||
| 49 |