Ejemplo n.º 1
0
 /**
  * @group get_term_meta
  */
 public function test_get_term_meta_all()
 {
     $Meta = new Smart_Custom_Fields_Meta(get_term($this->term_id, 'category'));
     $Meta->update('text', 'hoge');
     $Meta->add('checkbox', 1);
     $Meta->add('checkbox', 2);
     // ループ内のチェックボックス(複数値項目)は必ずこのメタデータを持つ
     $Meta->add(SCF_Config::PREFIX . 'repeat-multiple-data', array('checkbox3' => array(1, 2)));
     $Meta->add('checkbox3', 1);
     $Meta->add('checkbox3', 2);
     $Meta->add('checkbox3', 3);
     $this->assertEquals(array('text' => 'hoge', 'checkbox' => array(1, 2), 'group-name-3' => array(array('text3' => '', 'checkbox3' => array(1)), array('text3' => '', 'checkbox3' => array(2, 3))), 'text-has-default' => '', 'text-has-not-default' => '', 'checkbox-has-default' => array(), 'checkbox-has-not-default' => array()), SCF::get_term_meta($this->term_id, 'category'));
 }