[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/web_spider/tests/cases/ -> lmbUriContentReaderTest.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 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/lmbUriContentReader.class.php');
  11  
  12  Mock :: generate('lmbUri', 'MockUri');
  13  
  14  class lmbUriContentReaderTest extends UnitTestCase
  15  {
  16    function testOpen()
  17    {
  18      $uri = new MockUri();
  19      $reader = new lmbUriContentReader();
  20      $uri->expectOnce('toString');
  21      $uri->setReturnValue('toString', dirname(__FILE__) . '/../html/index.html');
  22      $reader->open($uri);
  23      $this->assertFalse($reader->getContentType()); // since opening a plain text file not html over http

  24      $this->assertEqual($reader->getContent(),
  25                         file_get_contents(dirname(__FILE__) . '/../html/index.html'));
  26    }
  27  
  28    function TODO_testGetLazyContent()
  29    {
  30    }
  31  }
  32  
  33  ?>


Generated: Mon Dec 1 03:56:46 2008 Cross-referenced by PHPXref 0.7