Files
phpy/tests/phpunit/IterTest.php
T
2023-12-06 11:21:01 +08:00

23 lines
475 B
PHP

<?php
use PHPUnit\Framework\TestCase;
class IterTest extends TestCase
{
function testIter()
{
$os = PyCore::import('os');
$uname = $os->uname();
$iter = PyCore::iter($uname);
$this->assertTrue($iter instanceof PyIter);
$list = [];
while ($next = PyCore::next($iter)) {
$list[] = PyCore::scalar($next);
}
$this->assertIsArray($list);
$this->assertEquals(count($list), 5);
}
}