assertTrue($str->endswith('swoole')); $this->assertTrue($str->startswith('hello')); $this->assertFalse($str->endswith('golang')); $s2 = $str->replace('swoole', 'java'); $this->assertTrue($s2->endswith('java')); } public function testBytes() { $os = PyCore::import('os'); $bytes = PyCore::scalar($os->urandom(128)); $this->assertEquals(128, strlen($bytes)); } }