示例#1
0
 /**
  * format() should return string if format is html
  */
 public function testFormat_returnsString_ifFormatIsText()
 {
     $symbol = new Underscore();
     $expected = '-';
     $actual = $symbol->format('text');
     $this->assertEquals($expected, $actual);
     return;
 }
示例#2
0
 /**
  * Get a method name by its alias
  *
  * @param  string $method The method
  *
  * @return string The real method name
  */
 public static function getAliasOf($method)
 {
     return Underscore::option('aliases.' . $method);
 }
示例#3
0
 public function getInstance()
 {
     if (!isset(self::$_instance)) {
         $c = __CLASS__;
         self::$_instance = new $c();
     }
     return self::$_instance;
 }
示例#4
0
 public function testAppend()
 {
     $array = [1, 2, 3];
     $newArray = Underscore::append($array, 4);
     $this->assertEquals([1, 2, 3, 4], $newArray);
 }