graychen / generatestring
生成一段小字符串
v1.0.0
2017-08-25 05:20 UTC
Requires (Dev)
- phpunit/phpunit: 4.8.1
This package is not auto-updated.
Last update: 2024-09-15 01:58:58 UTC
README
使用方法
<?php namespace graychen\Test; use graychen\generatestring; class generatestringTest extends \PHPUnit_Framework_TestCase { private $string; public function setUp() { $this->string=new generatestring(); } public function testGetchars() { $result = $this->string->getchars("a", 10); $this->assertEquals('aaaaaaaaaa', $result); } public function testGetchars_t() { $result = $this->string->getchars_t("abc", 10); $this->assertEquals('abcabcabcabcabcabcabcabcabcabc', $result); } public function testGetchars_p() { $result = $this->string->getchars_p("abc", 10); $this->assertEquals('abcabcabcabcabcabcabcabcabcabc', $result); } public function testGetcharscmp() { $result = $this->string->getcharscmp("abc", 10); $this->assertEquals('abcabcabca', $result); } public function testGetchars_s() { $result = $this->string->getchars_s("abc", 10); $this->assertEquals('abcabcabcabcabcabcabcabcabcabc', $result); } }