Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
Merge pull request #519 from Hackwar/junit6
Browse files Browse the repository at this point in the history
UT 6/10: Adding Unittests for document and error package
  • Loading branch information
eddieajau committed Nov 13, 2011
2 parents 80c35f0 + 1de820a commit 72ee4e3
Show file tree
Hide file tree
Showing 17 changed files with 1,286 additions and 18 deletions.
30 changes: 13 additions & 17 deletions tests/suite/joomla/document/JDocumentRendererTest.php
Expand Up @@ -27,36 +27,32 @@ class JDocumentRendererTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
//$this->object = new JDocumentRenderer;
}

/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
$doc = new JDocument;
$this->object = new JDocumentRenderer($doc);
}

/**
* Test JDocumentRenderer::render().
*
* Empty test because the base class does nothing
*
* @since 11.3
*/
public function testRender()
{
$doc = new JDocument;
$this->object = new JDocumentRenderer($doc);
$this->object->render('test');
$this->assertThat(
$this->object->render('test'),
$this->equalTo(null)
);
}

/**
* @todo Implement testGetContentType().
* Test JDocumentRenderer::getContentType().
*
* @since 11.3
*/
public function testGetContentType()
{
$doc = new JDocument;
$this->object = new JDocumentRenderer($doc);
$this->assertThat(
$this->object->getContentType(),
$this->equalTo('text/html')
Expand Down
81 changes: 81 additions & 0 deletions tests/suite/joomla/document/error/JDocumentErrorTest.php
@@ -0,0 +1,81 @@
<?php
/**
* @package Joomla.UnitTest
* @subpackage Document
*
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

include_once JPATH_PLATFORM . '/joomla/document/error/error.php';

/**
* Test class for JDocumentError.
* Generated by PHPUnit on 2011-10-26 at 19:36:13.
*/
class JDocumentErrorTest extends PHPUnit_Framework_TestCase {

/**
* @var JDocumentError
*/
protected $object;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp() {
$this->object = new JDocumentError;
}

/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown() {

}

/**
* @todo Implement testSetError().
*/
public function testSetError() {
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}

/**
* @todo Implement testRender().
*/
public function testRender() {
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}

/**
* @todo Implement test_loadTemplate().
*/
public function test_loadTemplate() {
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}

/**
* @todo Implement testRenderBacktrace().
*/
public function testRenderBacktrace() {
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}

}

?>
48 changes: 48 additions & 0 deletions tests/suite/joomla/document/feed/JFeedEnclosureTest.php
@@ -0,0 +1,48 @@
<?php
/**
* @package Joomla.UnitTest
*
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

include_once JPATH_PLATFORM . '/joomla/document/feed/feed.php';

/**
* Test class for JFeedEnclosure.
* Generated by PHPUnit on 2011-10-26 at 19:36:22.
*/
class JFeedEnclosureTest extends PHPUnit_Framework_TestCase {

/**
* @var JFeedEnclosure
*/
protected $object;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp() {
//$this->object = new JFeedEnclosure;
}

/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown() {

}

/**
* @todo Decide how to Implement.
*/
public function testDummy()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
}
}

?>
48 changes: 48 additions & 0 deletions tests/suite/joomla/document/feed/JFeedImageTest.php
@@ -0,0 +1,48 @@
<?php
/**
* @package Joomla.UnitTest
*
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

include_once JPATH_PLATFORM . '/joomla/document/feed/feed.php';

/**
* Test class for JFeedImage.
* Generated by PHPUnit on 2011-10-26 at 19:36:21.
*/
class JFeedImageTest extends PHPUnit_Framework_TestCase {

/**
* @var JFeedImage
*/
protected $object;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp() {
//$this->object = new JFeedImage;
}

/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown() {

}

/**
* @todo Decide how to Implement.
*/
public function testDummy()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
}
}

?>
50 changes: 50 additions & 0 deletions tests/suite/joomla/document/feed/JFeedItemTest.php
@@ -0,0 +1,50 @@
<?php
/**
* @package Joomla.UnitTest
*
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

include_once JPATH_PLATFORM . '/joomla/document/feed/feed.php';

/**
* Test class for JFeedItem.
* Generated by PHPUnit on 2011-10-26 at 19:36:18.
*/
class JFeedItemTest extends PHPUnit_Framework_TestCase {

/**
* @var JFeedItem
*/
protected $object;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp() {
$this->object = new JFeedItem;
}

/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown() {

}

/**
* @todo Implement testSetEnclosure().
*/
public function testSetEnclosure() {
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}

}

?>

0 comments on commit 72ee4e3

Please sign in to comment.