Passage en Namespace et tous les tests fonctionnels OK

This commit is contained in:
2021-05-10 11:48:15 +02:00
parent 536dd0d56b
commit eb30d8ef97
56 changed files with 1091 additions and 964 deletions

View File

@@ -7,21 +7,23 @@
namespace Domframework\Tests;
use Domframework\Rss;
/** Test the RSS */
class rssTest extends \PHPUnit_Framework_TestCase
class RssTest extends \PHPUnit_Framework_TestCase
{
public function test_empty0 ()
{
// Empty
$this->expectException ("Exception", "No title is provided for this RSS");
$rss = new rss ();
$rss = new Rss ();
$res = $rss->asXML ();
}
public function test_functional1 ()
{
// Functionnal 1
$rss = new rss ();
$rss = new Rss ();
$rss->title ("Global Title")
->link ("http://localhost")
->language ("fr-fr")
@@ -62,7 +64,7 @@ class rssTest extends \PHPUnit_Framework_TestCase
// Missing global description
$this->expectException ("Exception",
"No description is provided for this RSS");
$rss = new rss ();
$rss = new Rss ();
$rss->title ("Global Title")
->link ("http://localhost")
->language ("fr-fr");
@@ -73,7 +75,7 @@ class rssTest extends \PHPUnit_Framework_TestCase
{
// Missing global link
$this->expectException ("Exception", "No link is provided for this RSS");
$rss = new rss ();
$rss = new Rss ();
$rss->title ("Global Title")
->language ("fr-fr")
->description ("The Super Global Description");
@@ -84,7 +86,7 @@ class rssTest extends \PHPUnit_Framework_TestCase
{
// Missing global title
$this->expectException ("Exception", "No title is provided for this RSS");
$rss = new rss ();
$rss = new Rss ();
$rss->link ("http://localhost")
->language ("fr-fr")
->description ("The Super Global Description");
@@ -96,7 +98,7 @@ class rssTest extends \PHPUnit_Framework_TestCase
// Invalid date provided
$this->expectException ("Exception",
"lastBuildDate provided to RSS is not a valid date");
$rss = new rss ();
$rss = new Rss ();
$rss->title ("Global Title")
->link ("http://localhost")
->lastBuildDate ("2017-04-33")
@@ -110,7 +112,7 @@ class rssTest extends \PHPUnit_Framework_TestCase
// Empty Item provided
$this->expectException ("Exception",
"No title nor description defined in the RSS item");
$rss = new rss ();
$rss = new Rss ();
$rss->title ("Global Title")
->link ("http://localhost")
->lastBuildDate ("2017-04-30 12:35:32")
@@ -125,7 +127,7 @@ class rssTest extends \PHPUnit_Framework_TestCase
// Item without Title and Description
$this->expectException ("Exception",
"No title nor description defined in the RSS item");
$rss = new rss ();
$rss = new Rss ();
$rss->title ("Global Title")
->link ("http://localhost")
->lastBuildDate ("2017-04-30 12:35:32")
@@ -140,7 +142,7 @@ class rssTest extends \PHPUnit_Framework_TestCase
// Item with invalid date
$this->expectException ("Exception",
"pubDate provided to RSS Item is not a valid date");
$rss = new rss ();
$rss = new Rss ();
$rss->title ("Global Title")
->link ("http://localhost")
->lastBuildDate ("2017-10-30 12:35:32")