/** * @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); }
/** * 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; }
/** * @param $url * * @return string */ private function get_expected_image_output($url) { // get expected output self::$class_instance->image_output($url); $expected = ob_get_contents(); ob_clean(); // reset shown_images array self::$class_instance->shown_images = array(); return $expected; }
/** * @covers WPSEO_Twitter::gallery_images_output() */ public function test_gallery_images() { $ids = array(); $expected = $this->metatag('card', 'gallery'); // Insert images into DB so we have something to test against foreach (range(0, 3) as $i) { $filename = "image{$i}.jpg"; $ids[] = $this->factory->attachment->create_object($filename, 0, array('post_mime_type' => 'image/jpeg', 'post_type' => 'attachment')); $expected .= $this->metatag('image' . $i, 'http://' . WP_TESTS_DOMAIN . "/wp-content/uploads/{$filename}"); } // Create and go to post $content = '[gallery ids="' . join(',', $ids) . '"]'; $post_id = $this->factory->post->create(array('post_content' => $content)); $this->go_to(get_permalink($post_id)); self::$class_instance->type(); self::$class_instance->image(); $this->expectOutput($expected); }
public function image() { return parent::image(); }