Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix check style #1771

Merged
merged 1 commit into from

2 participants

@elkuku

No description provided.

@ianmacl ianmacl merged commit f587272 into joomla:staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 22, 2012
  1. @elkuku

    Fix check style

    elkuku authored
This page is out of date. Refresh to see the latest.
View
2  bin/keychain.php
@@ -258,6 +258,7 @@ private function dumpVar($var)
var_dump($var);
$result = trim(ob_get_contents());
ob_end_clean();
+
return $result;
}
@@ -292,6 +293,7 @@ protected function listEntries()
foreach ($this->keychain->toArray() as $key => $value)
{
$line = $key;
+
if ($this->input->get('print-values'))
{
$line .= ': ' . $this->dumpVar($value);
View
14 tests/suites/unit/JLoaderTest.php
@@ -889,14 +889,12 @@ protected function unregisterLoaders()
// Unregister all Joomla loader functions if registered.
foreach ($loaders as $loader)
{
- if (is_array($loader) && $loader[0] === 'JLoader' &&
- ($loader[1] === 'load'
- || $loader[1] === '_autoload'
- || $loader[1] === 'loadByNamespaceLowerCase'
- || $loader[1] === 'loadByNamespaceNaturalCase'
- || $loader[1] === 'loadByNamespaceMixedCase'
- )
- )
+ if (is_array($loader) && $loader[0] === 'JLoader'
+ && ($loader[1] === 'load'
+ || $loader[1] === '_autoload'
+ || $loader[1] === 'loadByNamespaceLowerCase'
+ || $loader[1] === 'loadByNamespaceNaturalCase'
+ || $loader[1] === 'loadByNamespaceMixedCase'))
{
spl_autoload_unregister($loader);
}
View
10 tests/suites/unit/JloaderNamespaceTest.php
@@ -179,12 +179,10 @@ protected function unregisterLoaders()
// Unregister the namespace auto loaders if any.
foreach ($loaders as $loader)
{
- if (is_array($loader) && $loader[0] === 'JLoader' &&
- ($loader[1] === 'loadByNamespaceLowerCase'
- || $loader[1] === 'loadByNamespaceNaturalCase'
- || $loader[1] === 'loadByNamespaceMixedCase'
- )
- )
+ if (is_array($loader) && $loader[0] === 'JLoader'
+ && ($loader[1] === 'loadByNamespaceLowerCase'
+ || $loader[1] === 'loadByNamespaceNaturalCase'
+ || $loader[1] === 'loadByNamespaceMixedCase'))
{
spl_autoload_unregister($loader);
}
View
6 tests/suites/unit/joomla/application/JApplicationWebTest.php
@@ -486,7 +486,7 @@ public function testCompressWithNoAcceptEncodings()
(object) array(
'cachable' => null,
'headers' => null,
- 'body' => array(str_replace("\r\n","\n",$string)),
+ 'body' => array(str_replace("\r\n", "\n", $string)),
)
);
@@ -540,7 +540,7 @@ public function testCompressWithHeadersSent()
(object) array(
'cachable' => null,
'headers' => null,
- 'body' => array(str_replace("\r\n","\n",$string)),
+ 'body' => array(str_replace("\r\n", "\n", $string)),
)
);
@@ -600,7 +600,7 @@ public function testCompressWithUnsupportedEncodings()
(object) array(
'cachable' => null,
'headers' => null,
- 'body' => array(str_replace("\r\n","\n",$string)),
+ 'body' => array(str_replace("\r\n", "\n", $string)),
)
);
View
2  tests/suites/unit/joomla/data/setTest.php
@@ -481,9 +481,11 @@ public function test_foreach()
$this->_instance['5'] = new JData;
$runs = 0;
+
foreach ($this->_instance as $k => $v)
{
$runs += 1;
+
if ($k != 3)
{
unset($this->_instance[$k]);
View
1  tests/suites/unit/joomla/database/database/JDatabaseExporterMySqlTest.php
@@ -286,6 +286,7 @@ public function testBuildXml()
</table_structure>
</database>
</mysqldump>';
+
// Replace used to prevent platform conflicts
$this->assertThat(
preg_replace('/\v/', '', $instance->buildXml()),
View
2  tests/suites/unit/joomla/database/database/JDatabaseExporterPostgresqlTest.php
@@ -289,6 +289,7 @@ public function test__toString()
</table_structure>
</database>
</postgresqldump>';
+
// Replace used to prevent platform conflicts
$this->assertThat(
preg_replace('/\v/', '', (string) $instance),
@@ -364,6 +365,7 @@ public function testBuildXml()
</table_structure>
</database>
</postgresqldump>';
+
// Replace used to prevent platform conflicts
$this->assertThat(
preg_replace('/\v/', '', $instance->buildXml()),
View
7 tests/suites/unit/joomla/database/stubs/nosqldriver.php
@@ -399,6 +399,8 @@ public static function isSupported()
/**
* Method to commit a transaction.
*
+ * @param boolean $toSavepoint Savepoint name.
+ *
* @return void
*
* @since 11.4
@@ -411,6 +413,8 @@ public function transactionCommit($toSavepoint = false)
/**
* Method to roll back a transaction.
*
+ * @param boolean $toSavepoint Savepoint name.
+ *
* @return void
*
* @since 11.4
@@ -423,10 +427,11 @@ public function transactionRollback($toSavepoint = false)
/**
* Method to initialize a transaction.
*
+ * @param boolean $asSavepoint Savepoint name.
+ *
* @return void
*
* @since 11.4
- * @throws RuntimeException
*/
public function transactionStart($asSavepoint = false)
{
View
14 tests/suites/unit/joomla/filesystem/JFilesystemPatcherTest.php
@@ -122,7 +122,8 @@ public function addData()
+Deeper and more profound,
+The door of all subtleties!
';
- // use of realpath to ensure test works for on all platforms
+
+ // Use of realpath to ensure test works for on all platforms
return array(
array(
$udiff,
@@ -131,19 +132,19 @@ public function addData()
array(
array(
'udiff' => $udiff,
- 'root' => realpath(JPATH_TESTS . '/tmp/patcher').DIRECTORY_SEPARATOR,
+ 'root' => realpath(JPATH_TESTS . '/tmp/patcher') . DIRECTORY_SEPARATOR,
'strip' => 0
)
)
),
array(
$udiff,
- realpath(JPATH_TESTS . '/tmp/patcher').DIRECTORY_SEPARATOR,
+ realpath(JPATH_TESTS . '/tmp/patcher') . DIRECTORY_SEPARATOR,
0,
array(
array(
'udiff' => $udiff,
- 'root' => realpath(JPATH_TESTS . '/tmp/patcher').DIRECTORY_SEPARATOR,
+ 'root' => realpath(JPATH_TESTS . '/tmp/patcher') . DIRECTORY_SEPARATOR,
'strip' => 0
)
)
@@ -232,7 +233,8 @@ public function testAddFile()
+Deeper and more profound,
+The door of all subtleties!
';
- // use of realpath to ensure test works for on all platforms
+
+ // Use of realpath to ensure test works for on all platforms
file_put_contents(JPATH_TESTS . '/tmp/patcher/lao2tzu.diff', $udiff);
$patcher = JFilesystemPatcher::getInstance()->reset();
$patcher->addFile(JPATH_TESTS . '/tmp/patcher/lao2tzu.diff', realpath(JPATH_TESTS . '/tmp/patcher'));
@@ -241,7 +243,7 @@ public function testAddFile()
array(
array(
'udiff' => $udiff,
- 'root' => realpath(JPATH_TESTS . '/tmp/patcher').DIRECTORY_SEPARATOR,
+ 'root' => realpath(JPATH_TESTS . '/tmp/patcher') . DIRECTORY_SEPARATOR,
'strip' => 0
)
),
View
16 tests/suites/unit/joomla/filesystem/JFolderTest.php
@@ -118,7 +118,7 @@ public function testFiles()
file_put_contents(JPath::clean(JPATH_TESTS . '/tmp/test/test/index.html'), 'test');
file_put_contents(JPath::clean(JPATH_TESTS . '/tmp/test/test/index.txt'), 'test');
- // use of realpath to ensure test works for on all platforms
+ // Use of realpath to ensure test works for on all platforms
$result = JFolder::files(JPath::clean(JPATH_TESTS . '/tmp/test'), 'index.*', true, true, array('index.html'));
$result[0] = realpath($result[0]);
$result[1] = realpath($result[1]);
@@ -131,7 +131,7 @@ public function testFiles()
'Line: ' . __LINE__ . ' Should exclude index.html files'
);
- // use of realpath to ensure test works for on all platforms
+ // Use of realpath to ensure test works for on all platforms
$result = JFolder::files(JPath::clean(JPATH_TESTS . '/tmp/test'), 'index.html', true, true);
$result[0] = realpath($result[0]);
$result[1] = realpath($result[1]);
@@ -153,7 +153,7 @@ public function testFiles()
'Line: ' . __LINE__ . ' Should include only file names of both index.html files'
);
- // use of realpath to ensure test works for on all platforms
+ // Use of realpath to ensure test works for on all platforms
$result = JFolder::files(JPath::clean(JPATH_TESTS . '/tmp/test'), 'index.html', false, true);
$result[0] = realpath($result[0]);
$this->assertEquals(
@@ -216,7 +216,7 @@ public function testFolders()
JFolder::folders(JPath::clean(JPATH_TESTS . '/tmp/test'), 'bar1', true, true, array('foo1', 'foo2'))
);
- // use of realpath to ensure test works for on all platforms
+ // Use of realpath to ensure test works for on all platforms
$result = JFolder::folders(JPath::clean(JPATH_TESTS . '/tmp/test'), 'bar1', true, true, array('foo1'));
$result[0] = realpath($result[0]);
$this->assertEquals(
@@ -224,7 +224,7 @@ public function testFolders()
$result
);
- // use of realpath to ensure test works for on all platforms
+ // Use of realpath to ensure test works for on all platforms
$result = JFolder::folders(JPath::clean(JPATH_TESTS . '/tmp/test'), 'bar1', true, true);
$result[0] = realpath($result[0]);
$result[1] = realpath($result[1]);
@@ -236,7 +236,7 @@ public function testFolders()
$result
);
- // use of realpath to ensure test works for on all platforms
+ // Use of realpath to ensure test works for on all platforms
$result = JFolder::folders(JPath::clean(JPATH_TESTS . '/tmp/test'), 'bar', true, true);
$result[0] = realpath($result[0]);
$result[1] = realpath($result[1]);
@@ -252,7 +252,7 @@ public function testFolders()
$result
);
- // use of realpath to ensure test works for on all platforms
+ // Use of realpath to ensure test works for on all platforms
$result = JFolder::folders(JPath::clean(JPATH_TESTS . '/tmp/test'), '.', true, true);
$result[0] = realpath($result[0]);
$result[1] = realpath($result[1]);
@@ -285,7 +285,7 @@ public function testFolders()
JFolder::folders(JPath::clean(JPATH_TESTS . '/tmp/test'), '.', true, false)
);
- // use of realpath to ensure test works for on all platforms
+ // Use of realpath to ensure test works for on all platforms
$result = JFolder::folders(JPath::clean(JPATH_TESTS . '/tmp/test'), '.', false, true);
$result[0] = realpath($result[0]);
$result[1] = realpath($result[1]);
View
4 tests/suites/unit/joomla/keychain/keychainTest.php
@@ -25,7 +25,7 @@ class JKeychainTest extends PHPUnit_Framework_TestCase
*/
public static function setUpBeforeClass()
{
- // clean up files
+ // Clean up files
@unlink(__DIR__ . '/data/web-keychain.dat');
@unlink(__DIR__ . '/data/web-passphrase.dat');
@@ -41,7 +41,7 @@ public static function setUpBeforeClass()
*/
public static function tearDownAfterClass()
{
- // clean up files
+ // Clean up files
@unlink(__DIR__ . '/data/web-keychain.dat');
@unlink(__DIR__ . '/data/web-passphrase.dat');
parent::tearDownAfterClass();
View
5 tests/suites/unit/joomla/session/JSessionTest.php
@@ -103,6 +103,7 @@ public function testGetInstance($store, $options)
{
$oldSession = $this->object;
$newSession = JSession::getInstance($store, $options);
+
// The properties and values should be identical to each other.
$this->assertThat(
$oldSession,
@@ -110,7 +111,7 @@ public function testGetInstance($store, $options)
);
// They should be the same object.
- $this->assertSame($oldSession,$newSession);
+ $this->assertSame($oldSession, $newSession);
}
/**
@@ -201,7 +202,7 @@ public function testGetFormToken()
->with($this->equalTo('secret'))
->will($this->returnValue('abc'));
- $this->object->set('secret','abc');
+ $this->object->set('secret', 'abc');
$expected = md5('abc' . $user->get('id', 0) . $this->object->getToken(false));
$this->assertEquals($expected, $this->object->getFormToken(), 'Form token should be calculated as above.');
}
View
2  tests/suites/unit/joomla/table/JTableTest.php
@@ -175,7 +175,7 @@ public function testAddIncludePath()
$reflection = new ReflectionClass('JTable');
- // use of realpath to ensure test works for on all platforms
+ // Use of realpath to ensure test works for on all platforms
$this->assertEquals(
realpath(dirname($reflection->getFileName())),
realpath($result[0]),
View
8 tests/suites/unit/joomla/user/JUserTest.php
@@ -394,13 +394,15 @@ public function testGetTable()
public function testBind()
{
$array = array();
- $string = '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890';
+ $string = '12345678901234567890123456789012345678901234567890123456789012345678901234567890'
+ . '12345678901234567890123456789012345678901234567890123456789012345678901234567890'
+ . '1234567890123456789012345678901234567890';
$array['username'] = $string;
$array['password'] = $string;
$array['password2'] = $string;
- $testUser = new JUser();
+ $testUser = new JUser;
$result = $testUser->bind($array);
$this->assertTrue(
$result
@@ -416,7 +418,7 @@ public function testBind()
$array['password2'] = 'password_ok_not_same';
- $testUser = new JUser();
+ $testUser = new JUser;
$result = $testUser->bind($array);
$this->assertFalse(
$result
View
2  tests/suites/unit/joomla/view/JViewHtmlTest.php
@@ -106,7 +106,7 @@ public function testGetPath()
$paths->insert(__DIR__ . '/layouts1', 1);
$paths->insert(__DIR__ . '/layouts2', 2);
- // use of realpath to ensure test works for on all platforms
+ // Use of realpath to ensure test works for on all platforms
$this->assertEquals(realpath(__DIR__ . '/layouts2/olivia.php'), $this->_instance->getPath('olivia'));
$this->assertEquals(realpath(__DIR__ . '/layouts1/peter.php'), $this->_instance->getPath('peter'));
$this->assertEquals(realpath(__DIR__ . '/layouts2/fauxlivia.php'), $this->_instance->getPath('fauxlivia'));
View
5 tests/suites/unit/stubs/Color/Rgb/Red.php
@@ -16,6 +16,11 @@
*/
class Red
{
+ /**
+ * A color.
+ *
+ * @return string
+ */
public function color()
{
return 'red';
View
5 tests/suites/unit/stubs/Color2/Blue.php
@@ -16,6 +16,11 @@
*/
class Blue
{
+ /**
+ * A color.
+ *
+ * @return string
+ */
public function color()
{
return 'blue';
View
5 tests/suites/unit/stubs/animal1/cat.php
@@ -16,6 +16,11 @@
*/
class Cat
{
+ /**
+ * Say something.
+ *
+ * @return string
+ */
public function say()
{
return 'hello';
View
5 tests/suites/unit/stubs/animal2/dog.php
@@ -16,6 +16,11 @@
*/
class Dog
{
+ /**
+ * Say something.
+ *
+ * @return string
+ */
public function say()
{
return 'hello';
Something went wrong with that request. Please try again.