znt/module/search/test/tao/markkeywords.php

30 lines
1.8 KiB
PHP
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env php
<?php
/**
title=测试 searchTao::markKeywords();
timeout=0
cid=18331
- 执行searchTest模块的markKeywordsDirectTest方法参数是'This is a test content', 'test' @This is a <span class='text-danger'>test</span> content
- 执行searchTest模块的markKeywordsDirectTest方法参数是'This contains key1 and key2 words', 'key1 key2' @This contains <span class='text-danger'>key1</span> and <span class='text-danger'>key2</span> words
- 执行searchTest模块的markKeywordsDirectTest方法参数是'这是一个测试内容', '测试' @这是一个<span class='text-danger'>测试</span> 内容
- 执行searchTest模块的markKeywordsDirectTest方法参数是'Product version 12345 released', '12345' @Product version <span class='text-danger'>12345</span> released
- 执行searchTest模块的markKeywordsDirectTest方法参数是'No keywords here', '' @No keywords here
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/tao.class.php';
su('admin');
$searchTest = new searchTaoTest();
r($searchTest->markKeywordsDirectTest('This is a test content', 'test')) && p() && e("This is a <span class='text-danger'>test</span> content ");
r($searchTest->markKeywordsDirectTest('This contains key1 and key2 words', 'key1 key2')) && p() && e("This contains <span class='text-danger'>key1</span> and <span class='text-danger'>key2</span> words ");
r($searchTest->markKeywordsDirectTest('这是一个测试内容', '测试')) && p() && e("这是一个<span class='text-danger'>测试</span> 内容 ");
r($searchTest->markKeywordsDirectTest('Product version 12345 released', '12345')) && p() && e("Product version <span class='text-danger'>12345</span> released ");
r($searchTest->markKeywordsDirectTest('No keywords here', '')) && p() && e('No keywords here ');