Files
phpy/tests/phpunit/StrTest.php
T
tianfenghan 9336c2c025 init
2023-12-04 17:20:01 +08:00

19 lines
432 B
PHP

<?php
use PHPUnit\Framework\TestCase;
class StrTest extends TestCase
{
public function testStr()
{
$str = new PyStr("hello world, hello swoole");
$this->assertTrue($str->endswith('swoole'));
$this->assertTrue($str->startswith('hello'));
$this->assertFalse($str->endswith('golang'));
$s2 = $str->replace('swoole', 'java');
$this->assertTrue($s2->endswith('java'));
}
}