Files
huangjingfen/pro_v3.5.1/vendor/guzzlehttp/command/tests/ResultTest.php
apple 78de918c37 Initial commit: queue workspace
Made-with: Cursor
2026-03-21 02:55:24 +08:00

28 lines
731 B
PHP

<?php
namespace GuzzleHttp\Tests\Command;
use GuzzleHttp\Command\Result;
use PHPUnit\Framework\TestCase;
/**
* @covers \GuzzleHttp\Command\Result
* @covers \GuzzleHttp\Command\HasDataTrait
*/
class ResultTest extends TestCase
{
public function testHasData()
{
$c = new Result(['baz' => 'bar']);
$this->assertSame('bar', $c['baz']);
$this->assertSame(['baz' => 'bar'], $c->toArray());
$this->assertTrue(isset($c['baz']));
$c['fizz'] = 'buzz';
$this->assertCount(2, $c);
unset($c['fizz']);
$this->assertCount(1, $c);
$this->assertInstanceOf('Traversable', $c->getIterator());
$this->assertStringContainsString('bar', (string) $c);
}
}