| [ Index ] |
PHP Cross Reference of Limb3 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 * Limb PHP Framework 4 * 5 * @link http://limb-project.com 6 * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com) 7 * @license LGPL http://www.gnu.org/copyleft/lesser.html 8 */ 9 lmb_require('limb/net/src/lmbUri.class.php'); 10 lmb_require('limb/web_spider/src/lmbSearchIndexingObserver.class.php'); 11 lmb_require('limb/web_spider/src/lmbUriContentReader.class.php'); 12 13 class TestingSpiderIndexer 14 { 15 function index($uri, $content){} 16 } 17 18 Mock :: generate('lmbUriContentReader', 'MockUriContentReader'); 19 Mock :: generate('TestingSpiderIndexer', 'MockSearchIndexer'); 20 21 class lmbSearchIndexingObserverTest extends UnitTestCase 22 { 23 var $observer; 24 var $indexer; 25 var $reader; 26 27 function testNotify() 28 { 29 $reader = new MockUriContentReader(); 30 $reader->expectOnce('getUri'); 31 $reader->setReturnValue('getUri', $uri = new lmbUri('page.html')); 32 33 $reader->expectOnce('getContent'); 34 $reader->setReturnValue('getContent', $content = 'whatever'); 35 36 $indexer = new MockSearchIndexer(); 37 $indexer->expectOnce('index', array($uri, $content)); 38 39 $observer = new lmbSearchIndexingObserver($indexer); 40 $observer->notify($reader); 41 } 42 } 43 44 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Fri Nov 21 03:53:03 2008 | Cross-referenced by PHPXref 0.7 |