| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /inetpub/wwwroot/business/pms/modules/simplepie/ |
Upload File : |
<?php
// $Id: simplepie.test,v 1.1.2.1 2008/09/01 22:54:08 mustafau Exp $
/**
* @file
*/
/**
* SimplePieTestCase class.
*/
class SimplePieTestCase extends DrupalWebTestCase {
function getInfo() {
return array(
'name' => t('SimplePie Core test case'),
'description' => t('Tests whether SimplePie Core is working or not.'),
'group' => t('SimplePie Core'),
);
}
/**
* Implementation of setUp().
*/
function setUp() {
parent::setUp('simplepie');
}
function getRSS091Sample() {
$feed = <<<EOT
<?xml version="1.0" encoding="UTF-8"?>
<rss version="0.91">
<channel>
<title>Example</title>
<link>http://example.com</link>
<description>Example updates</description>
<language>en-us</language>
<copyright>Copyright 2000, Example team.</copyright>
<managingEditor>editor@example.com</managingEditor>
<webMaster>webmaster@example.com</webMaster>
<image>
<title>Example</title>
<url>http://example.com/images/druplicon.png</url>
<link>http://example.com</link>
<width>88</width>
<height>100</height>
<description>Example updates</description>
</image>
<item>
<title>Example turns one</title>
<link>http://example.com/example-turns-one</link>
<description>Example turns one.</description>
</item>
</channel>
</rss>
EOT;
$path = file_directory_path() . '/rss091.xml';
file_save_data($feed, $path);
return $path;
}
function testSimplePie() {
$url = file_create_url($this->getRSS091Sample());
$this->drupalGet($url);
$this->assertResponse(array(200), t('URL !url is accessible', array('!url' => $url)));
$simplepie = simplepie_get($url, FALSE, FALSE);
$this->assertEqual('Example', $simplepie->get_title(), t('Feed title matches; !title.', array('!title' => $simplepie->get_title())));
}
}