graychen/generatestring

generate a little string

v1.0.0 2017-08-25 05:20 UTC

This package is not auto-updated.

Last update: 2024-11-10 02:40:02 UTC


README

Latest Stable Version Total Downloads License StyleCI Build Status Scrutinizer Code Quality Code Coverage Build Status

how to use

<?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);
    }
}