Exemple #1
0
 /**
  * @param string $type
  * @param string $url
  * @param array  $options
  *
  * @return string
  */
 public function auto_discovery_link_tag($t, $type, $url, array $options = array())
 {
     return $t->tags->tag('link', array('rel' => $options['rel'] ? $options['rel'] : 'alternate', 'type' => $options['type'] ? $options['type'] : "application/{$type}+xml", 'title' => $options['title'] ? $options['title'] : Core_Strings::upcase($type), 'href' => $url)) . "\n";
 }
Exemple #2
0
 public static function flip_column($type)
 {
     $map = self::get_flip_columns_type_map();
     $type = Core_Strings::upcase($type);
     $res = array(null, null);
     if (isset($map[$type])) {
         $res = explode(':', $map[$type]);
     }
     return $res;
 }
Exemple #3
0
 public function test_upcase()
 {
     $this->assertEquals(Core_Strings::upcase('StRiNG'), 'STRING');
     $this->assertEquals(Core_Strings::upcase('ЯблоЧныЙ сироП'), 'ЯБЛОЧНЫЙ СИРОП');
 }
Exemple #4
0
 public function __call($method, $args)
 {
     switch ($method) {
         case 'columns':
             $this->set_columns($args);
             break;
         case 'offset':
             $this->{$method} = $args[0];
             break;
         case 'from':
         case 'where':
         case 'having':
         case 'order_by':
         case 'group_by':
             foreach (Core_Arrays::flatten($args) as $arg) {
                 $target =& $this->{$method};
                 $target[] = $arg;
             }
             break;
         case 'left_join':
         case 'right_join':
         case 'inner_join':
         case 'outer_join':
             $this->joins[] = array(Core_Strings::upcase(Core_Strings::replace($method, '_join', '')), Core_Arrays::shift($args), $args);
             break;
     }
     return $this;
 }
Exemple #5
0
 /**
  * @param Dev_Unit_TestResult $result
  *
  * @return Dev_Unit_Run_Text_TestRunner
  */
 protected function print_errors_for(Dev_Unit_TestResult $result)
 {
     foreach (array('failures', 'errors') as $flavour) {
         if (Core::with_attr($result, "num_of_{$flavour}") > 0) {
             $this->stream->format("%s\n%s\n", Dev_Unit_Run_Text::DELIMITER1, Core_Strings::upcase($flavour));
             foreach ($result->{$flavour} as $item) {
                 $this->stream->format("%s (%d)\n  %s\n", $item->file, $item->line, $item->message);
             }
         }
     }
     return $this;
 }