/**
  * End a form, receives the html output
  *
  * @covers Yoast_GA_Admin::end_form()
  */
 public function test_end_form()
 {
     $output = null;
     $output .= '<div class="ga-form ga-form-input">';
     $output .= '<input type="submit" name="ga-form-submit" value="Save changes" class="button button-primary ga-form-submit" id="yoast-ga-form-submit-phpunit">';
     $output .= '</div></form>';
     $this->assertEquals($this->class_instance->end_form(), $output);
 }
コード例 #2
0
 /**
  * Test track full url option
  *
  * @covers Yoast_GA_Admin::get_track_full_url()
  */
 public function test_get_track_full_url()
 {
     $track_options = $this->class_instance->get_track_full_url();
     $track_options_result = is_array($track_options);
     if ($track_options) {
         foreach ($track_options as $values) {
             $this->assertArrayHasKey('id', $values);
             $this->assertArrayHasKey('name', $values);
             if (isset($values['name'])) {
                 $this->assertNotEmpty($values['name']);
             }
         }
     } else {
         $this->assertTrue($track_options_result);
     }
 }
コード例 #3
0
ファイル: class-admin.php プロジェクト: phupx/genco
 /**
  * Get the singleton instance of this class
  *
  * @return object
  */
 public static function get_instance()
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     return self::$instance;
 }