lint: apply phpcbf to tests/

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
This commit is contained in:
VirtualTam 2018-10-13 00:35:47 +02:00
parent 93bf0918fa
commit 067c2dd8f5
26 changed files with 38 additions and 43 deletions

View file

@ -5,7 +5,8 @@ require_once 'application/HttpUtils.php';
/** /**
* Unitary tests for getIpAddressFromProxy() * Unitary tests for getIpAddressFromProxy()
*/ */
class GetIpAdressFromProxyTest extends PHPUnit_Framework_TestCase { class GetIpAdressFromProxyTest extends PHPUnit_Framework_TestCase
{
/** /**
* Test without proxy * Test without proxy

View file

@ -410,4 +410,3 @@ function ut_curl_getinfo_rs_ct_ko($ch, $type)
return 'text/plain'; return 'text/plain';
} }
} }

View file

@ -218,7 +218,6 @@ class RouterTest extends PHPUnit_Framework_TestCase
Router::$PAGE_CHANGEPASSWORD, Router::$PAGE_CHANGEPASSWORD,
Router::findPage('do=changepasswd&stuff', array(), true) Router::findPage('do=changepasswd&stuff', array(), true)
); );
} }
/** /**

View file

@ -98,17 +98,19 @@ class ThumbnailerTest extends TestCase
ini_set('error_log', $oldlog); ini_set('error_log', $oldlog);
} }
protected function rrmdirContent($dir) { protected function rrmdirContent($dir)
{
if (is_dir($dir)) { if (is_dir($dir)) {
$objects = scandir($dir); $objects = scandir($dir);
foreach ($objects as $object) { foreach ($objects as $object) {
if ($object != "." && $object != "..") { if ($object != "." && $object != "..") {
if (is_dir($dir."/".$object)) if (is_dir($dir."/".$object)) {
$this->rrmdirContent($dir."/".$object); $this->rrmdirContent($dir."/".$object);
else } else {
unlink($dir."/".$object); unlink($dir."/".$object);
} }
} }
} }
} }
} }
}

View file

@ -31,7 +31,7 @@ class DummyUpdater extends Updater
* *
* @return bool true. * @return bool true.
*/ */
private final function updateMethodDummy1() final private function updateMethodDummy1()
{ {
return true; return true;
} }
@ -41,7 +41,7 @@ class DummyUpdater extends Updater
* *
* @return bool true. * @return bool true.
*/ */
private final function updateMethodDummy2() final private function updateMethodDummy2()
{ {
return true; return true;
} }
@ -51,7 +51,7 @@ class DummyUpdater extends Updater
* *
* @return bool true. * @return bool true.
*/ */
private final function updateMethodDummy3() final private function updateMethodDummy3()
{ {
return true; return true;
} }
@ -61,7 +61,7 @@ class DummyUpdater extends Updater
* *
* @throws Exception error. * @throws Exception error.
*/ */
private final function updateMethodException() final private function updateMethodException()
{ {
throw new Exception('whatever'); throw new Exception('whatever');
} }

View file

@ -107,4 +107,3 @@ class CleanupUrlTest extends PHPUnit_Framework_TestCase
); );
} }
} }

View file

@ -28,4 +28,3 @@ class GetUrlSchemeTest extends PHPUnit_Framework_TestCase
$this->assertEquals('git', get_url_scheme('git://domain.tld/push?pull=clone#checkout')); $this->assertEquals('git', get_url_scheme('git://domain.tld/push?pull=clone#checkout'));
} }
} }

View file

@ -28,4 +28,3 @@ class UnparseUrlTest extends PHPUnit_Framework_TestCase
$this->assertEquals($ref, unparse_url(parse_url($ref))); $this->assertEquals($ref, unparse_url(parse_url($ref)));
} }
} }

View file

@ -135,13 +135,13 @@ class UrlTest extends PHPUnit_Framework_TestCase
'about://reader?url=' . urlencode(self::$baseUrl .'?my=stuff&is=kept') 'about://reader?url=' . urlencode(self::$baseUrl .'?my=stuff&is=kept')
); );
$this->assertEquals(self::$baseUrl.'?my=stuff&is=kept', $url->cleanup()); $this->assertEquals(self::$baseUrl.'?my=stuff&is=kept', $url->cleanup());
} }
/** /**
* Test default http scheme. * Test default http scheme.
*/ */
public function testDefaultScheme() { public function testDefaultScheme()
{
$url = new Url(self::$baseUrl); $url = new Url(self::$baseUrl);
$this->assertEquals('http', $url->getScheme()); $this->assertEquals('http', $url->getScheme());
$url = new Url('domain.tld'); $url = new Url('domain.tld');

View file

@ -187,7 +187,8 @@ class UtilsTest extends PHPUnit_Framework_TestCase
/** /**
* Test generate location with valid data. * Test generate location with valid data.
*/ */
public function testGenerateLocation() { public function testGenerateLocation()
{
$ref = 'http://localhost/?test'; $ref = 'http://localhost/?test';
$this->assertEquals($ref, generateLocation($ref, 'localhost')); $this->assertEquals($ref, generateLocation($ref, 'localhost'));
$ref = 'http://localhost:8080/?test'; $ref = 'http://localhost:8080/?test';
@ -199,7 +200,8 @@ class UtilsTest extends PHPUnit_Framework_TestCase
/** /**
* Test generate location - anti loop. * Test generate location - anti loop.
*/ */
public function testGenerateLocationLoop() { public function testGenerateLocationLoop()
{
$ref = 'http://localhost/?test'; $ref = 'http://localhost/?test';
$this->assertEquals('?', generateLocation($ref, 'localhost', array('test'))); $this->assertEquals('?', generateLocation($ref, 'localhost', array('test')));
} }
@ -207,7 +209,8 @@ class UtilsTest extends PHPUnit_Framework_TestCase
/** /**
* Test generate location - from other domain. * Test generate location - from other domain.
*/ */
public function testGenerateLocationOut() { public function testGenerateLocationOut()
{
$ref = 'http://somewebsite.com/?test'; $ref = 'http://somewebsite.com/?test';
$this->assertEquals('?', generateLocation($ref, 'localhost')); $this->assertEquals('?', generateLocation($ref, 'localhost'));
} }

View file

@ -4,7 +4,6 @@ namespace Shaarli\Api;
use Shaarli\Base64Url; use Shaarli\Base64Url;
/** /**
* Class ApiUtilsTest * Class ApiUtilsTest
*/ */

View file

@ -3,7 +3,6 @@
namespace Shaarli\Api\Controllers; namespace Shaarli\Api\Controllers;
use Shaarli\Config\ConfigManager; use Shaarli\Config\ConfigManager;
use Slim\Container; use Slim\Container;
use Slim\Http\Environment; use Slim\Http\Environment;

View file

@ -2,7 +2,6 @@
namespace Shaarli\Api\Controllers; namespace Shaarli\Api\Controllers;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Shaarli\Config\ConfigManager; use Shaarli\Config\ConfigManager;
use Slim\Container; use Slim\Container;

View file

@ -3,7 +3,6 @@
namespace Shaarli\Api\Controllers; namespace Shaarli\Api\Controllers;
use Shaarli\Config\ConfigManager; use Shaarli\Config\ConfigManager;
use Slim\Container; use Slim\Container;
use Slim\Http\Environment; use Slim\Http\Environment;

View file

@ -3,7 +3,6 @@
namespace Shaarli\Api\Controllers; namespace Shaarli\Api\Controllers;
use Shaarli\Api\Exceptions\ApiBadParametersException; use Shaarli\Api\Exceptions\ApiBadParametersException;
use Shaarli\Config\ConfigManager; use Shaarli\Config\ConfigManager;
use Slim\Container; use Slim\Container;

View file

@ -3,7 +3,6 @@
namespace Shaarli; namespace Shaarli;
use Shaarli\Config\ConfigManager; use Shaarli\Config\ConfigManager;
/** /**

View file

@ -15,7 +15,8 @@ class PluginQrcodeTest extends PHPUnit_Framework_TestCase
/** /**
* Reset plugin path * Reset plugin path
*/ */
public function setUp() { public function setUp()
{
PluginManager::$PLUGINS_PATH = 'plugins'; PluginManager::$PLUGINS_PATH = 'plugins';
} }

View file

@ -8,7 +8,6 @@ ReferenceSessionIdHashes::genAllHashes();
use \Shaarli\Security\SessionManager; use \Shaarli\Security\SessionManager;
use \PHPUnit\Framework\TestCase; use \PHPUnit\Framework\TestCase;
/** /**
* Test coverage for SessionManager * Test coverage for SessionManager
*/ */

View file

@ -150,8 +150,8 @@ class ReferenceLinkDB
$tags, $tags,
$updated = '', $updated = '',
$shorturl = '', $shorturl = '',
$pinned = false) $pinned = false
{ ) {
$link = array( $link = array(
'id' => $id, 'id' => $id,
'title' => $title, 'title' => $title,