예제 #1
0
 public function testNoElements()
 {
     $ts = new \NG\Root\Type\TString();
     $this->assertTrue($ts->length() == 0);
     $ts = new \NG\Root\Type\TString(null);
     $this->assertTrue($ts->length() == 0);
 }
예제 #2
0
 /**
  * Converts the value to camel-case format
  * @param php string $separator
  * @return php string
  */
 public function toCamelCase($separator = ' ')
 {
     $complete = '';
     $parts = $this->explode($separator);
     foreach ($parts->value() as $key => $part) {
         $part = new \NG\Root\Type\TString($part);
         if ($key == 0) {
             $complete = $part->toLowerCase()->value();
         } else {
             $complete .= $part->ucfirst()->value();
         }
     }
     $cut = new \NG\Root\Type\TString($complete);
     return $cut->cut(1, $cut->length() - 1);
 }