Пример #1
0
									</div>
								</div>
							</div>
							<div class="[ column xmall-6 medium-3 ][ margin-bottom ]">
								<h3>Contact Us</h3>
								<p class="[ no-margin ]">Sydney, Australia</p>
								<p class="[ no-margin ]"><?php 
echo get_contact_phone();
?>
</p>
								<p class="[ no-margin ]"><a href="mailto:<?php 
echo get_contact_email();
?>
">Email Us</a></p>
								<p class="[ no-margin ]"><a href="<?php 
echo get_facebook_url();
?>
" target="_blank">Facebook</a></p>
							</div>
							<div class="[ clear--xmall ]"></div>
							<div class="[ column xmall-6 medium-3 ][ margin-bottom ]">
								<h3>Quick links</h3>
								<p class="[ no-margin ]"><a href="<?php 
echo site_url('about-us');
?>
">About Us</a></p>
								<p class="[ no-margin ]"><a href="<?php 
echo get_post_type_archive_link('faq');
?>
">FAQs</a></p>
								<p class="[ no-margin ]"><a href="<?php 
Пример #2
0
 private function test_utility_helper()
 {
     $this->unit->use_strict(true);
     $this->unit->run(get_github_url(), 'is_string', 'get_github_url()');
     $this->unit->run(get_facebook_url(), 'is_string', 'get_facebook_url()');
     $this->unit->run(get_twitter_url(), 'is_string', 'get_twitter_url()');
     $this->unit->run(get_google_map_key(), 'is_string', 'get_google_map_key()');
     $this->unit->run(get_ga_code(), 'is_string', 'get_ga_code()');
     $this->unit->run(is_null_or_empty_string(''), 'is_true', 'is_null_or_empty_string()');
     $this->unit->run(is_null_or_empty_string('test'), 'is_false', 'is_null_or_empty_string()');
     $this->unit->run(is_null_or_empty_string(1), 'is_false', 'is_null_or_empty_string()');
     $this->unit->run(start_with('abcdef', 'ab'), 'is_true', 'start_with()');
     $this->unit->run(start_with('abcdef', 'cd'), 'is_false', 'start_with()');
     $this->unit->run(start_with('abcdef', 'ef'), 'is_false', 'start_with()');
     $this->unit->run(start_with('abcdef', ''), 'is_true', 'start_with()');
     $this->unit->run(start_with('', 'abcdef'), 'is_false', 'start_with()');
     $this->unit->run(end_with("abcdef", "ab"), 'is_false', 'end_with()');
     $this->unit->run(end_with("abcdef", "cd"), 'is_false', 'end_with()');
     $this->unit->run(end_with("abcdef", "ef"), 'is_true', 'end_with()');
     $this->unit->run(end_with("abcdef", ""), 'is_true', 'end_with()');
     $this->unit->run(end_with("", "abcdef"), 'is_false', 'end_with()');
     $this->unit->run(get_domain_name('http://somedomain.co.uk'), 'somedomain.co.uk', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www2.manager.co.th'), 'manager.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://test.manager.co.th'), 'manager.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://manager.co.th'), 'manager.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://thaiware.com'), 'thaiware.com', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.thaiware.com'), 'thaiware.com', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://test.thaiware.com'), 'thaiware.com', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.studentloan.ktb.co.th/'), 'ktb.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.studentloan.ktb.co.th/dasdasdasd.html'), 'ktb.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.studentloan.ktb.co.th?quewadsas=2faddasdas'), 'ktb.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.studentloan.ktb.co.th/2011/20/01?=asdasdasdasd'), 'ktb.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://pantip.com/forum/siam'), 'pantip.com', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.wegointer.com/category/variety/'), 'wegointer.com', 'get_domain_name()');
     $this->unit->run(get_domain_name(), 'lab.jojoee.com', 'get_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.wegointer.com/category/variety/'), 'www.wegointer.com', 'get_domain_name()');
     $this->unit->run(get_full_domain_name('http://somedomain.co.uk'), 'somedomain.co.uk', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www2.manager.co.th'), 'www2.manager.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://test.manager.co.th'), 'test.manager.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://manager.co.th'), 'manager.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://thaiware.com'), 'thaiware.com', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.thaiware.com'), 'www.thaiware.com', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://test.thaiware.com'), 'test.thaiware.com', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.studentloan.ktb.co.th/'), 'www.studentloan.ktb.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.studentloan.ktb.co.th/dasdasdasd.html'), 'www.studentloan.ktb.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.studentloan.ktb.co.th?quewadsas=2faddasdas'), 'www.studentloan.ktb.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.studentloan.ktb.co.th/2011/20/01?=asdasdasdasd'), 'www.studentloan.ktb.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://pantip.com/forum/siam'), 'pantip.com', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.wegointer.com/category/variety/'), 'www.wegointer.com', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name(), 'lab.jojoee.com', 'get_full_domain_name()');
     $url = 'http://sub.wegointer.com/category/variety/';
     $this->unit->run(get_request_url($url, get_full_domain_name($url)), '/category/variety', 'get_request_url()');
     $url = 'http://www.wegointer.com/category/variety/';
     $this->unit->run(get_request_url($url, get_full_domain_name($url)), '/category/variety', 'get_request_url()');
     $this->unit->run(get_full_url(), 'http://lab.jojoee.com/nn/test', 'get_full_url()');
     // 404, 301
     // $this->unit->run(is_url_exists('http://jojoee.com/404'), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_url_exists('http://fashion.spokedark.tv/2015/04/24/dichan-magazine/'), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_url_exists('http://www.jojoee.com/'), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_url_exists('http://test4041.com/'), 'is_false', 'is_url_exists()');
     // $this->unit->run(is_url_exists('http://test4041.com/'), 'is_false', 'is_url_exists()');
     // $this->unit->run(is_url_redirects('http://www.jojoee.com/'), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_404('http://jojoee.com/404'), 'is_true', 'is_404()');
     // $url = 'http://fashion.spokedark.tv/?p=6600';
     // $this->unit->run(is_url_exists($url), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_url_redirects($url), 'is_true', 'is_url_redirects()');
     // don't know why it doesn't work
     // $url = 'http://movies.spokedark.tv?p=10054/';
     // $this->unit->run(is_url_exists($url), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_url_redirects($url), 'is_true', 'is_url_redirects()');
     $this->unit->run(get_extension('file.jpeg'), 'jpeg', 'get_extension()');
     $this->unit->run(get_extension('file.bk.zip'), 'zip', 'get_extension()');
     $this->unit->run(remove_trailing_slash('/category/product/'), '/category/product', 'remove_trailing_slash()');
     $this->unit->run(remove_trailing_slash('/category/product'), '/category/product', 'remove_trailing_slash()');
     $this->unit->run(remove_trailing_slash('category/product/'), 'category/product', 'remove_trailing_slash()');
     for ($i = 0; $i < 20; $i++) {
         $urls = $this->get_posts();
         foreach ($urls as $url) {
             $this->unit->run($url['is_publish'], '0', 'get_posts()');
         }
     }
 }