How to use testClass method of logo class

Best Atoum code snippet using logo.testClass

functions.php

Source:functions.php Github

copy

Full Screen

1<?php2define('XUSAH_VERSION', '1.0.8');3/**4 * storefront child theme functions.php file.5 *6 * @package storefront-child7 */8add_action( 'wp_enqueue_scripts', 'enqueue_custom_changes');9function enqueue_custom_changes() {10 wp_enqueue_style('custom-style', get_stylesheet_directory_uri() . '/custom.css', array(), XUSAH_VERSION);11 wp_enqueue_script('jquery');12 wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/custom.js', array('jquery'), XUSAH_VERSION);13}14// DO NOT REMOVE THIS FUNCTION AS IT LOADS THE PARENT THEME STYLESHEET15add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style');16function enqueue_parent_theme_style() {17 wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css', array(), XUSAH_VERSION );18}19/* Add any custom PHP below this line of text */20add_filter( 'woocommerce_breadcrumb_defaults', 'jk_change_breadcrumb_home_text' );21function jk_change_breadcrumb_home_text( $defaults ) {22 $defaults['home'] = 'home';23 return $defaults;24}25remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );26add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 20 );27remove_action ( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5); 28add_action ( 'woocommerce_after_single_product_summary', 'woocommerce_template_single_title', 1); 29remove_action ( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10); 30add_action ( 'woocommerce_after_single_product_summary', 'woocommerce_template_single_rating', 2); 31remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );32add_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 100 );33remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );34remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );35add_action( 'init', 'storefront_custom_logo' );36function storefront_custom_logo() {37 remove_action( 'storefront_header', 'storefront_site_branding', 20 );38 add_action( 'storefront_header', 'storefront_display_custom_logo', 20 );39}40function storefront_display_custom_logo() {41?>42 <a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="site-logo-link" rel="home">43 <span><?php echo __('xusah.boutique', 'storefront' ); ?></span>44 <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png" alt="<?php echo get_bloginfo( 'name' ); ?>" />45 </a>46<?php47}48// add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);49function custom_variation_price( $price, $product ) {50 $price = '';51 if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '<span class="from">' . _x('', 'min_price', 'woocommerce') . ' </span>';52 $price .= woocommerce_price($product->get_price());53 if ( $product->max_variation_price && $product->max_variation_price !== $product->min_variation_price ) {54 $price .= '<span class="to"> ' . _x('-', 'max_price', 'woocommerce') . ' </span>';55 $price .= woocommerce_price($product->max_variation_price);56 }57 return $price;58}59add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );60function woo_rename_tabs( $tabs ) {61 $tabs['description']['title'] = __( 'DESIGN' ); // Rename the description tab62 return $tabs;63}64function mpwoo_subscription_section_title($title){65return __('Newsletter:<br>want to get in the mu-hq loop? subscribe to our e-mail newsletter to receive fun stuff, special offers and enlightening input from the mu space station, directly to your inbox! *_*66', 'your-textdomain');67}68add_filter('mailpoet_woocommerce_subscription_section_title', 'mpwoo_subscription_section_title', 10, 1);69// WooCommerce Checkout Fields Hook70add_filter( 'woocommerce_checkout_fields' , 'custom_wc_checkout_fields' );71 72// Change order comments placeholder and label, and set billing phone number to not required.73function custom_wc_checkout_fields( $fields ) {74$fields['order']['order_comments']['placeholder'] = 'beam mu up! 🖖';75$fields['order']['order_comments']['label'] = 'for custom clothing, please type in the field below to include your measurements and any finer details or requests regarding fit, style, or color for your order! this is an online form, but there is a human being on the other end who will read every word and put their hands and heart into creating your order with great care... any other questions you may have concerning your purchase are most welcome as well!<div id="order-notes-heading">Order Notes:</div>';76$fields['billing']['billing_phone']['required'] = false;77return $fields;78}79add_filter( 'template_include', 'var_template_include', 1000 );80function var_template_include( $t ){81 $GLOBALS['current_theme_template'] = basename($t);82 return $t;83}84function get_current_template( $echo = false ) {85 if( !isset( $GLOBALS['current_theme_template'] ) )86 return false;87 if( $echo )88 echo $GLOBALS['current_theme_template'];89 else90 return $GLOBALS['current_theme_template'];91}92foreach ( array( 'pre_term_description' ) as $filter ) {93 remove_filter( $filter, 'wp_filter_kses' );94}95// Change PayPal Gateway Payment Icon96function newPayment_gateway_icon( $icon, $id ) {97 if ( $id === 'paypal' ) {98 return '<img src="' . get_stylesheet_directory_uri() . '/images/pp-logo.png" alt="PayPal" />';99 } else {100 return $icon;101 }102}103add_filter( 'woocommerce_gateway_icon', 'newPayment_gateway_icon', 10, 2 );104/**105 * Add new register fields for WooCommerce registration.106 *107 * @return string Register fields HTML.108 */109function wooc_extra_register_fields() {110 ?>111 <p class="form-row form-row-first">112 <label for="reg_billing_first_name"><?php _e( 'First name', 'woocommerce' ); ?> <span class="required">*</span></label>113 <input type="text" class="input-text" name="billing_first_name" id="reg_billing_first_name" value="<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?>" />114 </p>115 <p class="form-row form-row-last">116 <label for="reg_billing_last_name"><?php _e( 'Last name', 'woocommerce' ); ?> <span class="required">*</span></label>117 <input type="text" class="input-text" name="billing_last_name" id="reg_billing_last_name" value="<?php if ( ! empty( $_POST['billing_last_name'] ) ) esc_attr_e( $_POST['billing_last_name'] ); ?>" />118 </p>119 <div class="clear"></div>120 <?php121}122add_action( 'woocommerce_register_form_start', 'wooc_extra_register_fields' );123/**124 * Validate the extra register fields.125 *126 * @param string $username Current username.127 * @param string $email Current email.128 * @param object $validation_errors WP_Error object.129 *130 * @return void131 */132function wooc_validate_extra_register_fields( $username, $email, $validation_errors ) {133 if ( isset( $_POST['billing_first_name'] ) && empty( $_POST['billing_first_name'] ) ) {134 $validation_errors->add( 'billing_first_name_error', __( '<strong>Error</strong>: First name is required!', 'woocommerce' ) );135 }136 if ( isset( $_POST['billing_last_name'] ) && empty( $_POST['billing_last_name'] ) ) {137 $validation_errors->add( 'billing_last_name_error', __( '<strong>Error</strong>: Last name is required!.', 'woocommerce' ) );138 }139 if ( isset( $_POST['billing_phone'] ) && empty( $_POST['billing_phone'] ) ) {140 // $validation_errors->add( 'billing_phone_error', __( '<strong>Error</strong>: Phone is required!.', 'woocommerce' ) );141 }142}143add_action( 'woocommerce_register_post', 'wooc_validate_extra_register_fields', 10, 3 );144/**145 * Save the extra register fields.146 *147 * @param int $customer_id Current customer ID.148 *149 * @return void150 */151function wooc_save_extra_register_fields( $customer_id ) {152 if ( isset( $_POST['billing_first_name'] ) ) {153 // WordPress default first name field.154 update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );155 // WooCommerce billing first name.156 update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );157 }158 if ( isset( $_POST['billing_last_name'] ) ) {159 // WordPress default last name field.160 update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );161 // WooCommerce billing last name.162 update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );163 }164 if ( isset( $_POST['billing_phone'] ) ) {165 // WooCommerce billing phone166 update_user_meta( $customer_id, 'billing_phone', sanitize_text_field( $_POST['billing_phone'] ) );167 }168}169add_action( 'woocommerce_created_customer', 'wooc_save_extra_register_fields' );170add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );171function woo_remove_product_tabs( $tabs ) {172 173 unset( $tabs['additional_information'] ); // Remove the additional information tab174 175 return $tabs;176}177function filter_woocommerce_my_account_my_address_title( $var ) { 178 return '<span class="testclass">'.$var.'</span>'; 179}; 180add_filter( 'woocommerce_my_account_my_address_title', 'filter_woocommerce_my_account_my_address_title', 10, 1 ); 181function filter_woocommerce_my_account_get_addresses( $array, $customer_id ) { 182 $array['billing'] = '<span class="testclass">'.$array['billing'].'</span>';183 $array['shipping'] = '<span class="testclass">'.$array['shipping'].'</span>';184 return $array; 185}; 186add_filter( 'woocommerce_my_account_get_addresses', 'filter_woocommerce_my_account_get_addresses', 10, 2 ); 187function filter_woocommerce_my_account_my_orders_title( $var ) { 188 return '<span class="testclass">'.$var.'</span>'; 189}; 190add_filter( 'woocommerce_my_account_my_orders_title', 'filter_woocommerce_my_account_my_orders_title', 10, 3 ); 191/**192 * function to return an undo unsbscribe string for MailPoet newsletters193 * you could place it in the functions.php of your theme194 * @return string195 */196function mpoet_get_undo_unsubscribe(){197 if(class_exists('WYSIJA') && !empty($_REQUEST['wysija-key'])){198 $undo_paramsurl = array(199 'wysija-page'=>1,200 'controller'=>'confirm',201 'action'=>'undounsubscribe',202 'wysija-key'=>$_REQUEST['wysija-key']203 );204 $model_config = WYSIJA::get('config','model');205 $link_undo_unsubscribe = WYSIJA::get_permalink($model_config->getValue('confirmation_page'),$undo_paramsurl);206 $undo_unsubscribe = str_replace(array('[link]','[/link]'), array('<a href="'.$link_undo_unsubscribe.'">','</a>'),'<strong>'.__('Made a mistake? [link]Undo unsubscribe[/link].',WYSIJA)).'</strong>';207 return $undo_unsubscribe;208 }209 return '';210}211add_shortcode('mailpoet_undo_unsubscribe', 'mpoet_get_undo_unsubscribe');212add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );213function woo_reorder_tabs( $tabs ) {214 $tabs['description']['priority'] = 1; // We call it Design215 $tabs['reviews']['priority'] = 50; 216 return $tabs;217}218/**219 * Changes the redirect URL for the Return To Shop button in the cart.220 *221 * @return string222 */223function wc_empty_cart_redirect_url() {224 return '/product-category/clothing/';225}226add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_url' );227add_filter( 'wc_add_to_cart_message', 'remove_add_to_cart_message' );228function remove_add_to_cart_message() {229 return;230}231// Remove Google Font from Storefront theme232function remove_google_fonts(){233wp_dequeue_style('storefront-fonts');234}235add_action( 'wp_enqueue_scripts', 'remove_google_fonts', 999);236apply_filters( 'rocket_common_cache_logged_users', true );237?>...

Full Screen

Full Screen

ViewTest.php

Source:ViewTest.php Github

copy

Full Screen

...24 $root = self::$site->getRoot();25 $view = new Sorry\View(self::$site);26 $view->setTitle("Test Title");2728 $result = $view->header('testClass');29 $this->assertContains('<header class="sorryHeader">', $result);30 $this->assertContains("<figure><a href=\"$root/\"> <img src=\"images/sorrylogo.png\" width=\"425\" height=\"125\" alt=\"sorry logo\"></a></figure>", $result);31 $this->assertContains('<h1 class="testClass">Test Title</h1>', $result);3233 $this->assertNotContains("function pushInit(key) {34 var conn = new WebSocket('ws://webdev.cse.msu.edu/ws');35 conn.onopen = function (e) {36 console.log(\"Connection to push established!\");37 conn.send(key);38 };", $result);39 }4041 public function test_footer() {42 $view = new Sorry\View(self::$site);4344 $result = $view->footer();45 $this->assertContains('<footer class="sorryFooter">', $result); ...

Full Screen

Full Screen

header.php

Source:header.php Github

copy

Full Screen

1<!DOCTYPE html>2<html lang="en-US">3 <head>4 <?php wp_head() ?>5 <meta charset="UTF-8">6 <meta name="viewport" content="width-device-width, initial-scale=1">7 <title><?php wp_title(); ?></title>8 </head>9 10 <body>11 <!-- ************ Header *************-->12 13 <header>14 <div class="container flex-container flex-align">15 16 <!-- *********** LOGO **************-->17 <div class="logo">18 <a href="index.php">19 <?php20 //dump(get_field('logo_type', 'option'));21 //the_field('lauko_pavadinimas') - iskart spausdina22 if(get_field('logo_type', 'option')):23 $image = get_field('logo_image', 'option');24 ?>25 <img src="<?php echo $image['sizes']['logo']; ?>" alt="<?php bloginfo('name'); ?>">26 <?php27 else:28 the_field('logo_text', 'option');29 endif;30 ?>31 </a>32 </div>33 <!--************** LOGO ENDS ************-->34 <!--************ NAVIGATION START **************-->35 <div class="menu">36 <?php 37 $args = [38 'menu_class' => 'navigation_bar flex-container',39 'container' => false,40 'theme_location' => 'primary-navigation'41 ];42 wp_nav_menu($args);43 ?>44 </ul>45 <a href="#search">46 <i class="fa fa-search"></i>47 </a>48 <div class="burger hidden">49 <i class="fas fa-bars"></i>50 </div>51 <div id="search"> 52 <span class="close">X</span>53 <form role="search" id="searchform" action="/search" method="get">54 <input class="testclass" value="" name="q" type="search" placeholder="type to search"/>55 </form>56 </div>57 </div>58 </div>59 <!--************** NAVIGATION END *****************-->60 61 </header>62 ...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Atoum automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Trigger testClass code on LambdaTest Cloud Grid

Execute automation tests with testClass on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful