Skip to content

Commit

Permalink
Fix test issues and class declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Babker committed Nov 21, 2015
1 parent d6c6d2d commit aaa2de6
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 34 deletions.
3 changes: 1 addition & 2 deletions libraries/joomla/document/document.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ public static function getInstance($type = 'html', $attributes = array())
else
{
$ntype = $type;
$type = 'raw';
$class = 'JDocument' . $type;
$class = 'JDocumentRaw';
}
}

Expand Down
4 changes: 2 additions & 2 deletions libraries/joomla/document/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
jimport('joomla.utilities.utility');

/**
* DocumentHTML class, provides an easy interface to parse and display a HTML document
* JDocumentHtml class, provides an easy interface to parse and display a HTML document
*
* @since 11.1
*/
class JDocumentHTML extends JDocument
class JDocumentHtml extends JDocument
{
/**
* Array of Header <link> tags
Expand Down
4 changes: 2 additions & 2 deletions libraries/joomla/document/json.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
defined('JPATH_PLATFORM') or die;

/**
* JDocumentJSON class, provides an easy interface to parse and display JSON output
* JDocumentJson class, provides an easy interface to parse and display JSON output
*
* @see http://www.json.org/
* @since 11.1
*/
class JDocumentJSON extends JDocument
class JDocumentJson extends JDocument
{
/**
* Document name
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/suites/libraries/joomla/document/JDocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ public function testInjectingOptionsIntoTheObjectConstructor($options, $expects)
}

/**
* @testdox Test retrieving an instance of JDocumentHTML
* @testdox Test retrieving an instance of JDocumentHtml
*/
public function testRetrievingAnInstanceOfTheHtmlDocument()
{
$this->assertInstanceOf('JDocumentHTML', JDocument::getInstance());
$this->assertInstanceOf('JDocumentHtml', JDocument::getInstance());
}

/**
Expand Down Expand Up @@ -559,7 +559,7 @@ public function testTheDefaultReturnForGetTab()
public function testEnsureLoadRendererReturnsCorrectObject()
{
$this->object->setType('html');
$this->assertInstanceOf('JDocumentRendererHead', $this->object->loadRenderer('head'));
$this->assertInstanceOf('JDocumentRendererHtmlHead', $this->object->loadRenderer('head'));
}

/**
Expand All @@ -572,7 +572,7 @@ public function testEnsureLoadRendererReturnsCorrectObject()
public function testEnsureLoadRendererThrowsException()
{
$this->object->setType('html');
$this->assertInstanceOf('JDocumentRendererHead', $this->object->loadRenderer('unknown'));
$this->object->loadRenderer('unknown');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

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

/**
* Test class for JDocumentError
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

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

/**
* Test class for JDocumentFeed
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

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

/**
* Test class for JDocumentHTML
* Test class for JDocumentHtml
*/
class JDocumentHTMLTest extends TestCase
class JDocumentHtmlTest extends TestCase
{
/**
* @var JDocumentHTML
* @var JDocumentHtml
*/
protected $object;

Expand Down Expand Up @@ -77,7 +75,7 @@ protected function setUp()

JFactory::$language = JLanguage::getInstance('en-GB');

$this->object = new JDocumentHTML;
$this->object = new JDocumentHtml;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

require_once JPATH_PLATFORM . '/joomla/document/image/image.php';

/**
* Test class for JDocumentImage
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

require_once JPATH_PLATFORM . '/joomla/document/json/json.php';

/**
* Test class for JDocumentJSON
* Test class for JDocumentJson
*/
class JDocumentJSONTest extends TestCase
class JDocumentJsonTest extends TestCase
{
/**
* @var JDocumentJSON
* @var JDocumentJson
\ */
protected $object;

Expand All @@ -31,7 +29,7 @@ protected function setUp()

JFactory::$application = $this->getMockWeb();

$this->object = new JDocumentJSON;
$this->object = new JDocumentJson;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

require_once JPATH_PLATFORM . '/joomla/document/opensearch/opensearch.php';

/**
* Test class for JDocumentOpensearch
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

require_once JPATH_PLATFORM . '/joomla/document/raw/raw.php';

/**
* Test class for JDocumentRaw
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

require_once JPATH_PLATFORM . '/joomla/document/xml/xml.php';

/**
* Test class for JDocumentXml
*/
Expand Down

0 comments on commit aaa2de6

Please sign in to comment.