File: MultipleRequestsTest.php

package info (click to toggle)
php-embed 4.4.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,728 kB
  • sloc: php: 40,309; makefile: 23
file content (32 lines) | stat: -rw-r--r-- 974 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
declare(strict_types = 1);

namespace Embed\Tests;

use Embed\Embed;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

class MultipleRequestsTest extends TestCase
{
    #[Group('network')]
    public function testParallel()
    {
        $embed = new Embed();
        $infos = $embed->getMulti(
            'https://oscarotero.com',
            'https://github.com/oscarotero',
            'https://twitter.com/misteroom',
        );

        $this->assertCount(3, $infos);
        $this->assertEquals('https://oscarotero.com/', (string) $infos[0]->url);
        $this->assertEquals('Óscar Otero - Digital designer and developer', $infos[0]->title);

        $this->assertEquals('https://github.com/oscarotero', $infos[1]->url);
        $this->assertEquals('oscarotero - Overview', $infos[1]->title);

        $this->assertEquals('https://twitter.com/misteroom', $infos[2]->url);
        $this->assertEquals('en', $infos[2]->language);
    }
}