filename
stringlengths
11
137
content
stringlengths
6
292k
projects/plugins/jetpack/tests/php/modules/masterbar/test-class-dashboard-switcher-tracking.php
<?php /** * Test file for Dashboard_Switcher_Tracking * * @package automattic/jetpack */ use Automattic\Jetpack\Dashboard_Customizations\Dashboard_Switcher_Tracking; use Automattic\Jetpack\Tracking; require_once JETPACK__PLUGIN_DIR . 'modules/masterbar/admin-menu/class-dashboard-switcher-tracking.php'; /** * Cl...
projects/plugins/jetpack/tests/php/modules/masterbar/test-class-atomic-admin-menu.php
<?php /** * Tests for Atomic_Admin_Menu class. * * @package automattic/jetpack */ use Automattic\Jetpack\Dashboard_Customizations\Atomic_Admin_Menu; use Automattic\Jetpack\Status; require_once JETPACK__PLUGIN_DIR . 'modules/masterbar/admin-menu/class-atomic-admin-menu.php'; require_once JETPACK__PLUGIN_DIR . 'tes...
projects/plugins/jetpack/tests/php/modules/masterbar/test-class-admin-menu.php
<?php /** * Tests for Admin_Menu class. * * @package automattic/jetpack */ use Automattic\Jetpack\Dashboard_Customizations\Admin_Menu; use Automattic\Jetpack\Dashboard_Customizations\Base_Admin_Menu; use Automattic\Jetpack\Status; require_once JETPACK__PLUGIN_DIR . 'modules/masterbar/admin-menu/class-admin-menu.p...
projects/plugins/jetpack/tests/php/modules/masterbar/test-class-atomic-additional-css-manager.php
<?php /** * Test_WPORG_Additional_Css_Manager file. * Test WPORG_Additional_CSS_Manager. * * @package Jetpack */ namespace Automattic\Jetpack\Dashboard_Customizations; require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; require_once ABSPATH . WPINC . '/class-wp-customize-control.php'; require_once ...
projects/plugins/jetpack/tests/php/modules/masterbar/test-class-css-nudge-customize-control.php
<?php /** * CSS_Nudge_Customize_Control file. * Test CSS_Nudge_Customize_Control. * * @package Jetpack */ namespace Automattic\Jetpack\Dashboard_Customizations; require_once ABSPATH . WPINC . '/class-wp-customize-control.php'; require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; require_once JETPAC...
projects/plugins/jetpack/tests/php/modules/masterbar/test-class-domain-only-admin-menu.php
<?php /** * Tests for Domain_Only_Admin_Menu class. * * @package automattic/jetpack */ use Automattic\Jetpack\Dashboard_Customizations\Domain_Only_Admin_Menu; use Automattic\Jetpack\Status; require_once JETPACK__PLUGIN_DIR . 'modules/masterbar/admin-menu/class-domain-only-admin-menu.php'; require_once JETPACK__PL...
projects/plugins/jetpack/tests/php/modules/masterbar/test-class-base-admin-menu.php
<?php /** * Tests for Base_Admin_Menu class. * * @package automattic/jetpack */ require_once JETPACK__PLUGIN_DIR . 'modules/masterbar/admin-menu/class-base-admin-menu.php'; use Automattic\Jetpack\Dashboard_Customizations\Base_Admin_Menu; /** * Class Test_Base_Admin_Menu * * @coversDefaultClass Automattic\Jetp...
projects/plugins/jetpack/tests/php/modules/masterbar/test-class-masterbar.php
<?php /** * Tests for Masterbar class. * * @package automattic/jetpack */ use Automattic\Jetpack\Dashboard_Customizations\Masterbar; require_once JETPACK__PLUGIN_DIR . 'modules/masterbar/masterbar/class-masterbar.php'; /** * Class Test_Masterbar. * * @coversDefaultClass Automattic\Jetpack\Dashboard_Customizat...
projects/plugins/jetpack/tests/php/modules/masterbar/data/admin-menu.php
<?php /** * Fixture data for admin menu tests. * * @package automattic/jetpack */ /** * Menu fixture data. * * @return \string[][] */ function get_menu_fixture() { return array( 2 => array( 'Dashboard', 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboa...
projects/plugins/jetpack/tests/php/modules/sharedaddy/test-class.recaptcha.php
<?php require_once JETPACK__PLUGIN_DIR . 'modules/sharedaddy/recaptcha.php'; class WP_Test_Jetpack_ReCaptcha extends WP_UnitTestCase { private $site_key; private $secret_key; private $recaptcha; private $recaptcha_lazy; /** * Set up. */ public function set_up() { parent::set_up(); $this->site_key ...
projects/plugins/jetpack/tests/php/modules/likes/test_class.likes.php
<?php require __DIR__ . '/../../../../modules/likes.php'; class WP_Test_Likes extends WP_UnitTestCase { /** * Test that the actions are not added if likes are not visible. * * @since 8.4.0 */ public function test_action_init_likes_not_visible() { $instance = new Jetpack_Likes(); $instance->action_init()...
projects/plugins/jetpack/tests/php/modules/markdown/test_class-markdown.php
<?php /** * Class WP_Test_GFM_Markdown for unit testing special classic editor markdown features. */ /** * Include the module to ensure we're loading everything even though we're only testing the Markdown parser itself. */ require_once JETPACK__PLUGIN_DIR . 'modules/markdown/easy-markdown.php'; /** * @group mark...
projects/plugins/jetpack/tests/php/modules/comment-likes/test-class.comment-likes.php
<?php /** * Tests for the WP_Test_Comment_Likes class. * * @package automattic/jetpack * @since 8.4.0 */ /** Include comment-likes.php module */ require __DIR__ . '/../../../../modules/comment-likes.php'; /** * Test class for Jetpack_Comment_Likes. * * @since 8.4.0 */ class WP_Test_Comment_Likes extends WP_U...
projects/plugins/jetpack/tests/php/modules/contact-form/test-class.grunion-contact-form.php
<?php use Automattic\Jetpack\Forms\ContactForm\Contact_Form; use Automattic\Jetpack\Forms\ContactForm\Contact_Form_Field; use Automattic\Jetpack\Forms\ContactForm\Contact_Form_Plugin; use Automattic\Jetpack\Forms\ContactForm\Util; /** * Unit Tests for Contact_Form. * * @package automattic/jetpack */ /** * Test ...
projects/plugins/jetpack/tests/php/modules/related-posts/test_class_related_posts.php
<?php require __DIR__ . '/../../../../modules/related-posts.php'; class WP_Test_Jetpack_RelatedPosts extends WP_UnitTestCase { /** * Set up. */ public function set_up() { parent::set_up(); Jetpack_RelatedPosts_Module::instance()->action_on_load(); add_filter( 'jetpack_relatedposts_filter_options', '__re...
projects/plugins/jetpack/tests/php/modules/carousel/test-class.jetpack-carousel.php
<?php /** * Class WP_Test_Jetpack_Carousel. * * @package automattic/jetpack */ require_once JETPACK__PLUGIN_DIR . 'modules/carousel/jetpack-carousel.php'; /** * Class WP_Test_Jetpack_Carousel */ class WP_Test_Jetpack_Carousel extends WP_UnitTestCase { /** * The tested instance. * * @var Jetpack_Carousel...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.crowdsignal.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; /** * Test class for CrowdsignalShortcode * * @covers CrowdsignalShortcode */ class WP_Test_Jetpack_Shortcodes_CrowdSignal extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Set up. */ public function set_up() {...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.dailymotion.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Dailymotion extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * The global $content_width value. * * @var string */ const CONTENT_WIDTH = 600; /** * @author scotchfield * @c...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.archiveorg.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_ArchiveOrg extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Verify that [archiveorg] and [archiveorg-book] exists. * * @since 4.5.0 */ public function test_shortcodes_exists()...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.bandcamp.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Bandcamp extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * @author scotchfield * @covers ::shortcode_handler_bandcamp * @since 3.2 */ public function test_shortcodes_bandcamp_ex...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.medium.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Medium extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Verify that [medium] exists. * * @since 7.4.0 */ public function test_shortcodes_medium_exists() { $this->assertTrue(...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.slideshare.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Slideshare extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * @author scotchfield * @covers ::slideshare_shortcode * @since 3.2 */ public function test_shortcodes_slideshare_exis...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.googleapps.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_GoogleApps extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; public function test_presentation_variation_1() { $embed = '<iframe src="https://docs.google.com/present/embed?id=dhfhrphh_12...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.vimeo.php
<?php /** * Vimeo Shortcode and embed tests. * * @package automattic/jetpack */ /** * Shortcodes need external HTML requests to be converted to valid embed code (using smartframe's oembed endpoint) */ require_once __DIR__ . '/trait.http-request-cache.php'; /** * Test our Vimeo embed feature (shortcode as well ...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.youtube.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Youtube extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Mock global $content_width value. * * @var int */ const CONTENT_WIDTH = 600; /** * Tear down after each test. * ...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.tweet.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Tweet extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Set up. */ public function set_up() { parent::set_up(); if ( in_array( 'external-http', $this->getGroups(), true ) ) { ...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.vr.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_VR extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * @author mkaz * @covers ::jetpack_vr_viewer_shortcode * @since 4.5 */ public function test_shortcodes_vr_exists() { $this->...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.ustream.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Ustream extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Verify that [ustream] and [ustreamsocial] exists. * * @since 4.5.0 */ public function test_shortcodes_ustream_exists()...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.gist.php
<?php /** * Tests for the gist shortcode. * * @package automattic/jetpack */ // cache HTTP requests. require_once __DIR__ . '/trait.http-request-cache.php'; /** * Gist shortcode tests. */ class WP_Test_Jetpack_Shortcodes_Gist extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** ...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.others.php
<?php /** * Test Suite for extra oEmbed providers available in Jetpack. * * @package automattic/jetpack */ // Dummy comment so phpcs sees the above as a file doc comment. require_once __DIR__ . '/trait.http-request-cache.php'; /** * Test Extra embeds available. */ class WP_Test_Jetpack_Shortcodes_Others extends...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.slideshow.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; require_once JETPACK__PLUGIN_DIR . 'extensions/blocks/slideshow/slideshow.php'; class WP_Test_Jetpack_Shortcodes_Slideshow extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * The mock IDs. * * @var string */ publ...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.sitemap.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Sitemap extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Verify that [sitemap] exists. * * @since 4.5.0 */ public function test_shortcodes_sitemap_exists() { $this->assertTr...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.kickstarter.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Kickstarter extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Verify that [kickstarter] exists. * * @since 4.5.0 */ public function test_shortcodes_kickstarter_exists() { $th...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.soundcloud.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Soundcloud extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * @author scotchfield * @covers ::soundcloud_shortcode * @since 3.2 */ public function test_shortcodes_soundcloud_exis...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-oembed-pocketcasts.php
<?php /** * Tests PocketCasts oEmbed. */ require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_PocketCasts extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; const POCKETCASTS_BETA_TEST_URL = 'https://pcast.pocketcasts.net/drtlaf9s'; /** * Set up....
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.vine.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Vine extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * @author scotchfield * @covers ::vine_shortcode * @since 3.2 */ public function test_shortcodes_vine_exists() { $this->as...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.quiz.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Quiz extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Verify that [quiz] exists. * * @since 4.5.0 */ public function test_shortcodes_quiz_exists() { $this->assertTrue( short...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.getty.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Getty extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; const GETTY_IDENTIFIER = '82278805'; const GETTY_SHORTCODE = '[getty src="82278805" width="462" height="370"]'; const GETTY_SHORTCOD...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.archives.php
<?php require_once JETPACK__PLUGIN_DIR . '3rd-party/class.jetpack-amp-support.php'; require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Archives extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * @author scotchfield * @covers ::archives_shor...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.recipe.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; /** * Test class for Jetpack_Recipes * * @covers Jetpack_Recipes */ class WP_Test_Jetpack_Shortcodes_Recipe extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * The tested instance. * * @var Jetpack_Recipes */ ...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.gravatar.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Gravatar extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Verify that [gravatar] exists. * * @since 4.5.0 */ public function test_shortcodes_gravatar_exists() { $this->asser...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.facebook.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Facebook extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * After a test method runs, reset any state in WordPress the test method might have changed. */ public function tear_down() ...
projects/plugins/jetpack/tests/php/modules/shortcodes/trait.http-request-cache.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase /** * Trait to cache HTTP requests for unit tests. * * @package automattic/jetpack */ namespace Automattic\Jetpack\Tests; use ReflectionClass; use UnexpectedValueException; use WpOrg\Requests\Utility\CaseInsensitiveDictionary; /** * Trait to ...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.brightcove.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Brightcove extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Verify that [brightcove] exists. * * @since 4.5.0 */ public function test_shortcodes_brightcove_exists() { $this-...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.twitter-timeline.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; /** * Shortcode for Twitter Timeline * * Example: [twitter-timeline id="297487559557251073" username="wordpressdotcom"] * * Expected shortcode output: * <a class="twitter-timeline" data-partner="jetpack" data-width="100" data-height="100" data-widget...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.ted.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; /** * @covers ::shortcode_ted */ class WP_Test_Jetpack_Shortcodes_Ted extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Set up. */ public function set_up() { parent::set_up(); if ( in_array( 'external-http',...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.presentations.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Presentations extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * @author scotchfield * @covers Presentations::presentation_shortcode * @since 3.2 */ public function test_shortcod...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.scribd.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Scribd extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * @author scotchfield * @covers ::scribd_shortcode_handler * @since 3.2 */ public function test_shortcodes_scribd_exists()...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.inline-pdf.php
<?php /** * Unit test for Inline PDF embeds. * * @package automattic/jetpack * @since 8.4 */ // Dummy comment so phpcs sees the above as a file doc comment. require_once __DIR__ . '/trait.http-request-cache.php'; /** * Unit test for Inline PDF embeds. */ class WP_Test_Jetpack_Shortcodes_Inline_Pdfs extends W...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.mixcloud.php
<?php /** * WP_Test_Jetpack_Shortcodes_Mixcloud class * * @package automattic/jetpack */ // Dummy comment so phpcs sees the above as a file doc comment. require_once __DIR__ . '/trait.http-request-cache.php'; /** * Test class for the Mixcloud shortcode. */ class WP_Test_Jetpack_Shortcodes_Mixcloud extends WP_Un...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.smartframe.php
<?php /** * Unit tests for smartframe embedding * * Tests smartframe shortcodes and embed code * * @package automattic/jetpack */ /** * Shortcodes need external HTML requests to be converted to valid embed code (using smartframe's oembed endpoint) */ require_once __DIR__ . '/trait.http-request-cache.php'; /**...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.instagram.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; use Automattic\Jetpack\Constants; class WP_Test_Jetpack_Shortcodes_Instagram extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Mock global $content_width value. * * @var int */ const CONTENT_WIDTH = 640; /**...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.flickr.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Flickr extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Runs on every test. */ public function set_up() { parent::set_up(); $pre_http_req_function = function ( $preempt, $pars...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.googlemaps.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Googlemaps extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * @author scotchfield * @covers ::jetpack_googlemaps_shortcode * @since 3.2 */ public function test_shortcodes_googlem...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.spotify.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_Spotify extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Verify that [spotify] exists. * * @since 4.5.0 */ public function test_shortcodes_spotify_exists() { $this->assertTr...
projects/plugins/jetpack/tests/php/modules/shortcodes/test-class.mailchimp.php
<?php require_once __DIR__ . '/trait.http-request-cache.php'; class WP_Test_Jetpack_Shortcodes_MailChimp extends WP_UnitTestCase { use Automattic\Jetpack\Tests\HttpRequestCacheTrait; /** * Verify that [mailchimp] exists. * * @since 4.5.0 */ public function test_shortcodes_mailchimp_exists() { $this->as...
projects/plugins/jetpack/tests/php/modules/subscriptions/test_class.jetpack-subscriptions.php
<?php require_once JETPACK__PLUGIN_DIR . 'modules/subscriptions.php'; require_once JETPACK__PLUGIN_DIR . 'extensions/blocks/premium-content/_inc/subscription-service/include.php'; require_once JETPACK__PLUGIN_DIR . 'modules/memberships/class-jetpack-memberships.php'; require_once JETPACK__PLUGIN_DIR . 'extensions/bloc...
projects/plugins/jetpack/tests/php/modules/sso/test_class.jetpack-sso-helpers.php
<?php require_once __DIR__ . '/../../../../modules/sso/class.jetpack-sso-helpers.php'; /** * Testing functions in Jetpack_SSO_Helpers class. * * @since 4.1.0 */ class WP_Test_Jetpack_SSO_Helpers extends WP_UnitTestCase { protected $user_data; /** * Set up. */ public function set_up() { parent::set_up();...
projects/plugins/jetpack/tests/php/modules/theme-tools/test_functions.devicepx.php
<?php require_once JETPACK__PLUGIN_DIR . '/modules/theme-tools/devicepx.php'; class WP_Test_Jetpack_Theme_Tools_Devicepx extends WP_UnitTestCase { /** * @covers ::jetpack_devicepx_init */ public function test_devicepx_not_enqueued_by_default() { $this->assertFalse( current_theme_supports( 'jetpack-devicepx' ...
projects/plugins/jetpack/tests/php/modules/sitemaps/test-class.sitemap-librarian.php
<?php /** * Tests for the Jetpack_Sitemap_Librarian class. * * @package automattic/jetpack * @since 4.7.0 */ require_once JETPACK__PLUGIN_DIR . 'modules/sitemaps/sitemap-constants.php'; require_once JETPACK__PLUGIN_DIR . 'modules/sitemaps/sitemap-librarian.php'; /** * Test class for Jetpack_Sitemap_Librarian. ...
projects/plugins/jetpack/tests/php/modules/sitemaps/test-class.sitemap-buffer.php
<?php /** * Tests for the Jetpack_Sitemap_Buffer class. * * @package automattic/jetpack * @since 4.7.0 * * phpcs:disable Generic.Files.OneObjectStructurePerFile.MultipleFound */ require_once JETPACK__PLUGIN_DIR . 'modules/sitemaps/sitemap-constants.php'; require_once JETPACK__PLUGIN_DIR . 'modules/sitemaps/site...
projects/plugins/jetpack/tests/php/modules/sitemaps/test-class.sitemap-stylist.php
<?php /** * Tests for the Jetpack_Sitemap_Stylist class. * * @package automattic/jetpack * @since 4.7.0 */ require_once JETPACK__PLUGIN_DIR . 'modules/sitemaps/sitemap-stylist.php'; /** * Test class for Jetpack_Sitemap_Stylist. * * @since 4.7.0 */ class WP_Test_Jetpack_Sitemap_Stylist extends WP_UnitTestCase...
projects/plugins/jetpack/tests/php/modules/sitemaps/test-class.sitemap-constants.php
<?php /** * Tests for the sitemap constants. * * @package automattic/jetpack * @since 4.7.0 */ require_once JETPACK__PLUGIN_DIR . 'modules/sitemaps/sitemap-constants.php'; /** * Test class for Jetpack sitemap constants. * * @since 4.7.0 */ class WP_Test_Jetpack_Sitemap_Constants extends WP_UnitTestCase { /...
projects/plugins/jetpack/tests/php/modules/sitemaps/test-class.sitemaps.php
<?php require_once JETPACK__PLUGIN_DIR . 'modules/sitemaps/sitemaps.php'; class WP_Test_Jetpack_Sitemap_Manager extends WP_UnitTestCase { /** * Constructor does not throw any fatal errors. * * @covers Jetpack_Sitemap_Manager::__construct * @group jetpack-sitemap * @since 4.7.0 */ public function test_s...
projects/plugins/jetpack/tests/php/modules/sitemaps/test-class.sitemap-finder.php
<?php /** * Tests for the Jetpack_Sitemap_Finder class. * * @package automattic/jetpack * @since 4.7.0 */ require_once JETPACK__PLUGIN_DIR . 'modules/sitemaps/sitemaps.php'; require_once JETPACK__PLUGIN_DIR . 'modules/sitemaps/sitemap-finder.php'; /** * Test class for Jetpack_Sitemap_Finder. * * @since 4.7.0 ...
projects/plugins/jetpack/tests/php/modules/seo-tools/test-class.jetpack.seo-titles.php
<?php /** * Class WP_Test_Jetpack_SEO_Titles. * * @package automattic/jetpack */ require_once JETPACK__PLUGIN_DIR . 'modules/seo-tools/class-jetpack-seo-titles.php'; /** * Class WP_Test_Jetpack_SEO_Titles */ class WP_Test_Jetpack_SEO_Titles extends WP_UnitTestCase { /** * Test for expected output after sanit...
projects/plugins/jetpack/tests/php/modules/post-by-email/test-class.post-by-email-api.php
<?php /** * Automated testing of the post-by-email REST API. * * @package automattic/jetpack */ use Automattic\Jetpack\Connection\Rest_Authentication as Connection_Rest_Authentication; if ( defined( 'JETPACK__PLUGIN_DIR' ) && JETPACK__PLUGIN_DIR ) { require_once JETPACK__PLUGIN_DIR . 'modules/post-by-email.php';...
projects/plugins/jetpack/tests/php/modules/photon/test_class.jetpack-photon-static-asset-cdn.php
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase /** * The WP_Test_Jetpack_Photon_Static_Assets_CDN class file. * * @package automattic/jetpack */ require_once JETPACK__PLUGIN_DIR . 'modules/photon-cdn.php'; /** * Unit tests for the Jetpack_Photon_Static_Assets_CDN class. */ class WP_Test_Je...
projects/plugins/jetpack/tests/php/modules/widget-visibility/test_widget-visibility.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase require_once JETPACK__PLUGIN_DIR . 'modules/widget-visibility/widget-conditions.php'; /** * Test class for Jetpack_Widget_Conditions (widget visibility) * * To run: jetpack docker phpunit -- --filter=widget * * @covers Jetpack_Widget_Condition...
projects/plugins/jetpack/tests/php/modules/verification-tools/test_functions.verification-tools-utils.php
<?php require __DIR__ . '/../../../../modules/verification-tools/verification-tools-utils.php'; class WP_Test_Jetpack_Verification_Tools_Utils extends WP_UnitTestCase { /** * @author cbauerman * @covers ::jetpack_verification_validate * @since 6.5.0 */ public function test_jetpack_verification_validate_goog...
projects/plugins/jetpack/tests/php/modules/publicize/test_class.publicize.php
<?php // phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed if ( ! function_exists( 'publicize_init' ) ) { /** * Some tests rely on this function which won't get defined unless we mock lots * of things and require the module code. Instead we'll define it here. * * @return Publicize Object */ func...
projects/plugins/jetpack/tests/php/modules/widgets/test_twitter-timeline-widget.php
<?php // phpcs:ignore Wordpress.Files.FileName.NotHyphenatedLowercase /** * Test Jetpack_Twitter_Timeline_Widget. * * @package automattic/jetpack */ require __DIR__ . '/../../../../modules/widgets/twitter-timeline.php'; /** * Test Jetpack_Twitter_Timeline_Widget. */ class WP_Test_Twitter_Timeline_Widget extends...
projects/plugins/jetpack/tests/php/modules/widgets/test_social-icons-widget.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase require_once JETPACK__PLUGIN_DIR . 'modules/widgets/social-icons.php'; /** * Test class for the Social Icons Widget. * * @covers Jetpack_Widget_Social_Icons */ class WP_Test_Social_Icons_Widget extends WP_UnitTestCase { private $social_icon_w...
projects/plugins/jetpack/tests/php/modules/widgets/test_contact-info-widget.php
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase require_once JETPACK__PLUGIN_DIR . 'modules/widgets/contact-info.php'; /** * Test class for the Contact Info & Map Widget. * * @covers Jetpack_Contact_Info_Widget */ class WP_Test_Contact_Info_Widget extends WP_UnitTestCase { const TEST_API_K...
projects/plugins/jetpack/tests/php/modules/widgets/test_wordpress-post-widget.php
<?php require __DIR__ . '/../../../../modules/widgets/wordpress-post-widget.php'; class WP_Test_Jetpack_Display_Posts_Widget extends WP_UnitTestCase { /** * Jetpack_Display_Posts_Widget object. * * @var Jetpack_Display_Posts_Widget */ private $inst; /** * WP_Test_Jetpack_Display_Posts_Widget constructo...
projects/plugins/jetpack/tests/php/modules/widgets/migrate-to-core/test_migrate-to-core-gallery-widget.php
<?php require __DIR__ . '/../../../../../modules/widgets/migrate-to-core/gallery-widget.php'; class WP_Test_Jetpack_Migrate_Gallery_Widget extends WP_UnitTestCase { /** * Test jetpack_migrate_gallery_widget_upgrade_widget when called with a non-array */ public function test_jetpack_migrate_gallery_widget_upgrad...
projects/plugins/jetpack/tests/php/media/test-class.jetpack-post-images.php
<?php require_once JETPACK__PLUGIN_DIR . 'modules/shortcodes/slideshow.php'; class WP_Test_Jetpack_PostImages extends WP_UnitTestCase { /** * @author blobaugh * @author Alda Vigdís <alda.vigdis@automattic.com> * @covers Jetpack_PostImages::from_html * @since 2.7 */ public function test_from_html_single_q...
projects/plugins/jetpack/tests/php/media/test-class.jetpack-media-extractor.php
<?php require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.media-extractor.php'; class WP_Test_Jetpack_MediaExtractor extends WP_UnitTestCase { /** * @author scotchfield * @covers Jetpack_Media_Meta_Extractor::extract * @since 3.2 */ public function test_mediaextractor_extract_empty_array() { $post_id = se...
projects/plugins/jetpack/tests/php/media/test-class.jetpack-media-summary.php
<?php if ( ! class_exists( 'Jetpack_Media_Summary' ) ) { require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.media-summary.php'; } class WP_Test_Jetpack_MediaSummary extends WP_UnitTestCase { /** * @author scotchfield * @covers Jetpack_Media_Summary::get * @since 3.2 * @todo find a better way to test this l...
projects/plugins/jetpack/tests/php/src/test_class-jetpack-modules-overrides.php
<?php /** * Tests the Module Override functionality. * * @package automattic/jetpack */ /** * Class WP_Test_Jetpack_Modules_Overrides */ class WP_Test_Jetpack_Modules_Overrides extends WP_UnitTestCase { /** * Holder for the module override instance. * * @var Jetpack_Modules_Overrides */ private $instan...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-taxonomy-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Taxonomy endpoint. */ abstract class WPCOM_JSON_API_Taxonomy_Endpoint extends WPCOM_JSON_API_Endpoint { /** * Category object format. * * @var array */ public $category_object_format = array( 'ID' => '(int) The category I...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-taxonomy-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName new WPCOM_JSON_API_Get_Taxonomy_Endpoint( array( 'description' => 'Get information about a single category.', 'group' => 'taxonomy', 'stat' => 'categories:1...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-bulk-delete-post-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Bulk delete posts on a site. * * Endpoint: /sites/%s/posts/delete */ new WPCOM_JSON_API_Bulk_Delete_Post_Endpoint( array( 'description' => 'Delete multiple posts. Note: If the trash is enabled, this request will send non-trashed ...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-taxonomy-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Update site taxonomy API endpoints. * * Endpoints: * Create a new category: /sites/%s/categories/new * Create a new tag: /sites/%s/tags/new * Edit a category: /sites/%s/categories/slug:%s * Edit a tag: /sites/%s/tags/...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-comments-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Comments Walker Class. */ class WPCOM_JSON_API_List_Comments_Walker extends Walker { /** * Tree type. * * @var string */ public $tree_type = 'comment'; /** * Database fields. * * @var array */ public $db_fields = array( ...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-upload-media-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Upload media item API endpoint. * * Endpoint: /sites/%s/media/new */ new WPCOM_JSON_API_Upload_Media_Endpoint( array( 'description' => 'Upload a new media item.', 'group' => 'media', 'stat' => '...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-bulk-update-comments-endpoint.php
<?php //phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Endpoints: /sites/%s/comments/status * /sites/%s/comments/delete */ new WPCOM_JSON_API_Bulk_Update_Comments_Endpoint( array( 'description' => 'Update multiple comment\'s status.', 'group' => 'comments', ...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-term-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName new WPCOM_JSON_API_Get_Term_Endpoint( array( 'description' => 'Get information about a single term.', 'group' => 'taxonomy', 'stat' => 'terms:1', 'method'...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-customcss.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Custom Css endpoint * * Endpoint: https://public-api.wordpress.com/rest/v1.1/sites/$site/customcss/ */ new WPCOM_JSON_API_Get_CustomCss_Endpoint( array( 'description' => 'Retrieve custom-css data for a site.', 'group' =>...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-delete-media-endpoint.php
<?php // phpcs:ignore Squiz.Commenting.FileComment.Missing new WPCOM_JSON_API_Delete_Media_Endpoint( array( 'description' => 'Delete a piece of media.', 'group' => 'media', 'stat' => 'media:1:delete', 'method' => 'POST', 'path' => '/sites...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-sharing-buttons-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName // phpcs:disable Generic.Files.OneObjectStructurePerFile.MultipleFound /** * Sharing button endpoint class. */ abstract class WPCOM_JSON_API_Sharing_Button_Endpoint extends WPCOM_JSON_API_Endpoint { /** * All visibilties. * * @var array */...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-media-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName new WPCOM_JSON_API_Get_Media_Endpoint( array( 'description' => 'Get a single media item (by ID).', 'group' => 'media', 'stat' => 'media:1', 'method' => 'GET', 'path' => '...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-media-v1-2-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.media.php'; /** * List media v1_2 endpoint. */ new WPCOM_JSON_API_List_Media_v1_2_Endpoint( array( 'description' => 'Get a list of items in the media library.', 'group' ...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-comment-counts-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Endpoint: /sites/%s/comment-counts */ new WPCOM_JSON_API_GET_Comment_Counts_Endpoint( array( 'description' => 'Get comment counts for each available status', 'group' => 'comments', 'stat' => 'comments:1:comme...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-post-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Endpoints: /sites/%s/posts/%d -> $blog_id, $post_id * /sites/%s/posts/name:%s -> $blog_id, $post_id // not documented * /sites/%s/posts/slug:%s -> $blog_id, $post_id */ new WPCOM_JSON_API_Get_Post_Endpoint( array(...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-comment-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Endpoint: /sites/%s/comments/%d -> $blog_id, $comment_id */ new WPCOM_JSON_API_Get_Comment_Endpoint( array( 'description' => 'Get a single comment.', 'group' => 'comments', 'stat' ...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-site-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName new WPCOM_JSON_API_GET_Site_Endpoint( array( 'description' => 'Get information about a site.', 'group' => 'sites', 'stat' => 'sites:X', 'allowed_if_flagge...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-add-widget-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Activate a widget on a site. * * Endpoint: https://public-api.wordpress.com/rest/v1.1/sites/$site/widgets/new */ new WPCOM_JSON_API_Add_Widgets_Endpoint( array( 'description' => 'Activate a group of widgets on a site. The bulk ve...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Post v1_1 Endpoint class. */ abstract class WPCOM_JSON_API_Post_v1_1_Endpoint extends WPCOM_JSON_API_Endpoint { // phpcs:ignore PEAR.NamingConventions.ValidClassName.Invalid, Generic.Classes.OpeningBraceSameLine.ContentAfterBrace /** * Post...
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-media-v1-1-endpoint.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Update media item info v1.1 endpoint. * * Endpoint: v1.1/sites/%s/media/%d */ new WPCOM_JSON_API_Update_Media_v1_1_Endpoint( array( 'description' => 'Edit basic information about a media item.', 'group' => 'media...