Skip to content

Commit

Permalink
Merge pull request joomla#13391 from frankmayer/improvements-in-tests-1
Browse files Browse the repository at this point in the history
Some improvements in tests #1:
  • Loading branch information
wilsonge authored Dec 29, 2016
2 parents 89b8136 + 00a638d commit cfc690b
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion tests/unit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/
function jexit($message = 0)
{
return;
}

define('_JEXEC', 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public function connected()
*/
public function disconnect()
{
return;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/suites/libraries/joomla/form/JFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1467,15 +1467,15 @@ public function testLoad()
'Line:' . __LINE__ . ' The show_title in the params group has been replaced by show_abstract.'
);

$originalform = new JFormInspector('form1');
$originalform->load(JFormDataHelper::$loadDocument);
$originalset = $originalform->getXml()->xpath('/form/fields/field');
$originalForm = new JFormInspector('form1');
$originalForm->load(JFormDataHelper::$loadDocument);
$originalSet = $originalForm->getXml()->xpath('/form/fields/field');
$set = $form->getXml()->xpath('/form/fields/field');

for ($i = 0; $i < count($originalset); $i++)
for ($i = 0, $iMax = count($originalSet); $i < $iMax; ++$i)
{
$this->assertThat(
(string) ($originalset[$i]->attributes()->name) == (string) ($set[$i]->attributes()->name),
(string) $originalSet[$i]->attributes()->name === (string) $set[$i]->attributes()->name,
$this->isTrue(),
'Line:' . __LINE__ . ' Replace should leave fields in the original order.'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public function testConstructor02()
// Create a callback function (since php 5.3)
$callback = function ($entry)
{
return;
};

// Setup the basic configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected function tearDown()
*
* @return array
*/
Public function casesGetInstance()
public function casesGetInstance()
{
return array(
'first_instance' => array(
Expand Down
1 change: 0 additions & 1 deletion tests/unit/suites/libraries/legacy/error/JErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,5 @@ public function testSetErrorHandling()
*/
public function callbackHandler()
{
return;
}
}
1 change: 0 additions & 1 deletion tests/unit/suites/libraries/legacy/model/stubs/name.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ class NokeywordInName extends JModelLegacy
*/
public function __construct()
{
return;
}
}

0 comments on commit cfc690b

Please sign in to comment.