nulib/php/tests/strTest.php

29 lines
1019 B
PHP

<?php
namespace nulib;
use nulib\tests\TestCase;
class strTest extends TestCase {
function testCamel2us() {
self::assertSame("a", str::camel2us("a"));
self::assertSame("aa", str::camel2us("aa"));
self::assertSame("aaa", str::camel2us("aaa"));
self::assertSame("a", str::camel2us("A"));
self::assertSame("aa", str::camel2us("Aa"));
self::assertSame("aa", str::camel2us("AA"));
self::assertSame("aaa", str::camel2us("Aaa"));
self::assertSame("aaa", str::camel2us("AAA"));
self::assertSame("a_aa", str::camel2us("AAa"));
self::assertSame("a_b", str::camel2us("aB"));
self::assertSame("aa_bb", str::camel2us("aaBb"));
self::assertSame("aaa_bbb", str::camel2us("aaaBbb"));
self::assertSame("aa_bb", str::camel2us("AaBb"));
self::assertSame("aaa_bbb", str::camel2us("AaaBbb"));
self::assertSame("_aaa", str::camel2us("_aaa"));
self::assertSame("__aaa_bbb", str::camel2us("__aaaBbb"));
self::assertSame("___aaa_bbb", str::camel2us("___AaaBbb"));
}
}