Skip to content

Commit

Permalink
unify missing parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobion committed Nov 14, 2013
1 parent 2888594 commit 077a089
Show file tree
Hide file tree
Showing 21 changed files with 73 additions and 73 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Tests/ApplicationTest.php
Expand Up @@ -840,7 +840,7 @@ public function testTerminalDimensions()

protected function getDispatcher()
{
$dispatcher = new EventDispatcher;
$dispatcher = new EventDispatcher();
$dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) {
$event->getOutput()->write('before.');
});
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/EventDispatcher/Tests/EventTest.php
Expand Up @@ -35,7 +35,7 @@ class EventTest extends \PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->event = new Event;
$this->event = new Event();
$this->dispatcher = new EventDispatcher();
}

Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Form/Tests/FormFactoryBuilderTest.php
Expand Up @@ -27,12 +27,12 @@ protected function setUp()
$this->registry->setAccessible(true);

$this->guesser = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface');
$this->type = new FooType;
$this->type = new FooType();
}

public function testAddType()
{
$factoryBuilder = new FormFactoryBuilder;
$factoryBuilder = new FormFactoryBuilder();
$factoryBuilder->addType($this->type);

$factory = $factoryBuilder->getFormFactory();
Expand All @@ -46,7 +46,7 @@ public function testAddType()

public function testAddTypeGuesser()
{
$factoryBuilder = new FormFactoryBuilder;
$factoryBuilder = new FormFactoryBuilder();
$factoryBuilder->addTypeGuesser($this->guesser);

$factory = $factoryBuilder->getFormFactory();
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
Expand Up @@ -881,14 +881,14 @@ public function testGetClientIpsProvider()

public function testGetContentWorksTwiceInDefaultMode()
{
$req = new Request;
$req = new Request();
$this->assertEquals('', $req->getContent());
$this->assertEquals('', $req->getContent());
}

public function testGetContentReturnsResource()
{
$req = new Request;
$req = new Request();
$retval = $req->getContent(true);
$this->assertInternalType('resource', $retval);
$this->assertEquals("", fread($retval, 1));
Expand All @@ -901,7 +901,7 @@ public function testGetContentReturnsResource()
*/
public function testGetContentCantBeCalledTwiceWithResources($first, $second)
{
$req = new Request;
$req = new Request();
$req->getContent($first);
$req->getContent($second);
}
Expand Down Expand Up @@ -1361,7 +1361,7 @@ public function getBaseUrlData()
*/
public function testUrlencodedStringPrefix($string, $prefix, $expect)
{
$request = new Request;
$request = new Request();

$me = new \ReflectionMethod($request, 'getUrlencodedPrefix');
$me->setAccessible(true);
Expand Down
Expand Up @@ -758,7 +758,7 @@ public function testSettersAreChainable()
public function validContentProvider()
{
return array(
'obj' => array(new StringableObject),
'obj' => array(new StringableObject()),
'string' => array('Foo'),
'int' => array(2),
);
Expand Down
Expand Up @@ -59,7 +59,7 @@ protected function tearDown()
protected function getStorage(array $options = array())
{
$storage = new NativeSessionStorage($options);
$storage->registerBag(new AttributeBag);
$storage->registerBag(new AttributeBag());

return $storage;
}
Expand Down
Expand Up @@ -53,7 +53,7 @@ protected function tearDown()
protected function getStorage()
{
$storage = new PhpBridgeSessionStorage();
$storage->registerBag(new AttributeBag);
$storage->registerBag(new AttributeBag());

return $storage;
}
Expand Down
Expand Up @@ -42,7 +42,7 @@ protected function getMemcache()
$host = $matches[1] ?: $matches[2];
$port = $matches[3];

$memcache = new Memcache;
$memcache = new Memcache();
$memcache->addServer($host, $port);

$this->memcache = $memcache;
Expand Down
Expand Up @@ -42,7 +42,7 @@ protected function getMemcached()
$host = $matches[1] ?: $matches[2];
$port = $matches[3];

$memcached = new Memcached;
$memcached = new Memcached();

//disable compression to allow appending
$memcached->setOption(Memcached::OPT_COMPRESSION, false);
Expand Down
Expand Up @@ -19,7 +19,7 @@ class TimeDataCollectorTest extends \PHPUnit_Framework_TestCase
{
public function testCollect()
{
$c = new TimeDataCollector;
$c = new TimeDataCollector();

$request = new Request();
$request->server->set('REQUEST_TIME', 1);
Expand All @@ -35,7 +35,7 @@ public function testCollect()
$this->assertEquals(2000, $c->getStartTime());

$request = new Request();
$c->collect($request, new Response);
$c->collect($request, new Response());
$this->assertEquals(0, $c->getStartTime());

$kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
Expand Down
Expand Up @@ -20,7 +20,7 @@ class DumperPrefixCollectionTest extends \PHPUnit_Framework_TestCase
{
public function testAddPrefixRoute()
{
$coll = new DumperPrefixCollection;
$coll = new DumperPrefixCollection();
$coll->setPrefix('');

$route = new DumperRoute('bar', new Route('/foo/bar'));
Expand Down Expand Up @@ -66,7 +66,7 @@ public function testAddPrefixRoute()

public function testMergeSlashNodes()
{
$coll = new DumperPrefixCollection;
$coll = new DumperPrefixCollection();
$coll->setPrefix('');

$route = new DumperRoute('bar', new Route('/foo/bar'));
Expand Down
Expand Up @@ -76,7 +76,7 @@ public function testAddAndRemove()

public function testGetPattern()
{
$builder = new MaskBuilder;
$builder = new MaskBuilder();
$this->assertEquals(MaskBuilder::ALL_OFF, $builder->getPattern());

$builder->add('view');
Expand Down
Expand Up @@ -43,7 +43,7 @@ public function testAutoLoginReturnsNullWhenNoCookie()
public function testAutoLoginThrowsExceptionWhenImplementationDoesNotReturnUserInterface()
{
$service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null));
$request = new Request;
$request = new Request();
$request->cookies->set('foo', 'foo');

$service
Expand Down Expand Up @@ -106,8 +106,8 @@ public function testLoginFail()
public function testLoginSuccessIsNotProcessedWhenTokenDoesNotContainUserInterfaceImplementation()
{
$service = $this->getService(null, array('name' => 'foo', 'always_remember_me' => true, 'path' => null, 'domain' => null));
$request = new Request;
$response = new Response;
$request = new Request();
$response = new Response();
$account = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
Expand All @@ -129,8 +129,8 @@ public function testLoginSuccessIsNotProcessedWhenTokenDoesNotContainUserInterfa
public function testLoginSuccessIsNotProcessedWhenRememberMeIsNotRequested()
{
$service = $this->getService(null, array('name' => 'foo', 'always_remember_me' => false, 'remember_me_parameter' => 'foo', 'path' => null, 'domain' => null));
$request = new Request;
$response = new Response;
$request = new Request();
$response = new Response();
$account = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
Expand All @@ -153,8 +153,8 @@ public function testLoginSuccessIsNotProcessedWhenRememberMeIsNotRequested()
public function testLoginSuccessWhenRememberMeAlwaysIsTrue()
{
$service = $this->getService(null, array('name' => 'foo', 'always_remember_me' => true, 'path' => null, 'domain' => null));
$request = new Request;
$response = new Response;
$request = new Request();
$response = new Response();
$account = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
Expand All @@ -179,9 +179,9 @@ public function testLoginSuccessWhenRememberMeParameterWithPathIsPositive($value
{
$service = $this->getService(null, array('name' => 'foo', 'always_remember_me' => false, 'remember_me_parameter' => 'foo[bar]', 'path' => null, 'domain' => null));

$request = new Request;
$request = new Request();
$request->request->set('foo', array('bar' => $value));
$response = new Response;
$response = new Response();
$account = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
Expand All @@ -206,9 +206,9 @@ public function testLoginSuccessWhenRememberMeParameterIsPositive($value)
{
$service = $this->getService(null, array('name' => 'foo', 'always_remember_me' => false, 'remember_me_parameter' => 'foo', 'path' => null, 'domain' => null));

$request = new Request;
$request = new Request();
$request->request->set('foo', $value);
$response = new Response;
$response = new Response();
$account = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
Expand Down
Expand Up @@ -36,7 +36,7 @@ public function testAutoLoginReturnsNullWhenNoCookie()
public function testAutoLoginThrowsExceptionOnInvalidCookie()
{
$service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null, 'always_remember_me' => false, 'remember_me_parameter' => 'foo'));
$request = new Request;
$request = new Request();
$request->request->set('foo', 'true');
$request->cookies->set('foo', 'foo');

Expand All @@ -47,7 +47,7 @@ public function testAutoLoginThrowsExceptionOnInvalidCookie()
public function testAutoLoginThrowsExceptionOnNonExistentToken()
{
$service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null, 'always_remember_me' => false, 'remember_me_parameter' => 'foo'));
$request = new Request;
$request = new Request();
$request->request->set('foo', 'true');
$request->cookies->set('foo', $this->encodeCookie(array(
$series = 'fooseries',
Expand All @@ -70,7 +70,7 @@ public function testAutoLoginReturnsNullOnNonExistentUser()
{
$userProvider = $this->getProvider();
$service = $this->getService($userProvider, array('name' => 'foo', 'path' => null, 'domain' => null, 'always_remember_me' => true, 'lifetime' => 3600, 'secure' => false, 'httponly' => false));
$request = new Request;
$request = new Request();
$request->cookies->set('foo', $this->encodeCookie(array('fooseries', 'foovalue')));

$tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
Expand All @@ -95,7 +95,7 @@ public function testAutoLoginThrowsExceptionOnStolenCookieAndRemovesItFromThePer
{
$userProvider = $this->getProvider();
$service = $this->getService($userProvider, array('name' => 'foo', 'path' => null, 'domain' => null, 'always_remember_me' => true));
$request = new Request;
$request = new Request();
$request->cookies->set('foo', $this->encodeCookie(array('fooseries', 'foovalue')));

$tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
Expand Down Expand Up @@ -125,7 +125,7 @@ public function testAutoLoginThrowsExceptionOnStolenCookieAndRemovesItFromThePer
public function testAutoLoginDoesNotAcceptAnExpiredCookie()
{
$service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null, 'always_remember_me' => true, 'lifetime' => 3600));
$request = new Request;
$request = new Request();
$request->cookies->set('foo', $this->encodeCookie(array('fooseries', 'foovalue')));

$tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
Expand Down Expand Up @@ -159,7 +159,7 @@ public function testAutoLogin()
;

$service = $this->getService($userProvider, array('name' => 'foo', 'path' => null, 'domain' => null, 'secure' => false, 'httponly' => false, 'always_remember_me' => true, 'lifetime' => 3600));
$request = new Request;
$request = new Request();
$request->cookies->set('foo', $this->encodeCookie(array('fooseries', 'foovalue')));

$tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
Expand Down Expand Up @@ -207,8 +207,8 @@ public function testLogout()
public function testLogoutSimplyIgnoresNonSetRequestCookie()
{
$service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null));
$request = new Request;
$response = new Response;
$request = new Request();
$response = new Response();
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');

$tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
Expand All @@ -229,9 +229,9 @@ public function testLogoutSimplyIgnoresNonSetRequestCookie()
public function testLogoutSimplyIgnoresInvalidCookie()
{
$service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null));
$request = new Request;
$request = new Request();
$request->cookies->set('foo', 'somefoovalue');
$response = new Response;
$response = new Response();
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');

$tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
Expand Down Expand Up @@ -259,8 +259,8 @@ public function testLoginFail()
public function testLoginSuccessSetsCookieWhenLoggedInWithNonRememberMeTokenInterfaceImplementation()
{
$service = $this->getService(null, array('name' => 'foo', 'domain' => 'myfoodomain.foo', 'path' => '/foo/path', 'secure' => true, 'httponly' => true, 'lifetime' => 3600, 'always_remember_me' => true));
$request = new Request;
$response = new Response;
$request = new Request();
$response = new Response();

$account = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
$account
Expand Down
Expand Up @@ -44,7 +44,7 @@ public function testAutoLoginThrowsExceptionOnNonExistentUser()
{
$userProvider = $this->getProvider();
$service = $this->getService($userProvider, array('name' => 'foo', 'path' => null, 'domain' => null, 'always_remember_me' => true, 'lifetime' => 3600));
$request = new Request;
$request = new Request();
$request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time()+3600, 'foopass'));

$userProvider
Expand All @@ -61,7 +61,7 @@ public function testAutoLoginDoesNotAcceptCookieWithInvalidHash()
{
$userProvider = $this->getProvider();
$service = $this->getService($userProvider, array('name' => 'foo', 'path' => null, 'domain' => null, 'always_remember_me' => true, 'lifetime' => 3600));
$request = new Request;
$request = new Request();
$request->cookies->set('foo', base64_encode('class:'.base64_encode('foouser').':123456789:fooHash'));

$user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
Expand All @@ -86,7 +86,7 @@ public function testAutoLoginDoesNotAcceptAnExpiredCookie()
{
$userProvider = $this->getProvider();
$service = $this->getService($userProvider, array('name' => 'foo', 'path' => null, 'domain' => null, 'always_remember_me' => true, 'lifetime' => 3600));
$request = new Request;
$request = new Request();
$request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time() - 1, 'foopass'));

$user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
Expand Down Expand Up @@ -130,7 +130,7 @@ public function testAutoLogin()
;

$service = $this->getService($userProvider, array('name' => 'foo', 'always_remember_me' => true, 'lifetime' => 3600));
$request = new Request;
$request = new Request();
$request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time()+3600, 'foopass'));

$returnedToken = $service->autoLogin($request);
Expand Down Expand Up @@ -172,8 +172,8 @@ public function testLoginFail()
public function testLoginSuccessIgnoresTokensWhichDoNotContainAnUserInterfaceImplementation()
{
$service = $this->getService(null, array('name' => 'foo', 'always_remember_me' => true, 'path' => null, 'domain' => null));
$request = new Request;
$response = new Response;
$request = new Request();
$response = new Response();
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
->expects($this->once())
Expand All @@ -193,8 +193,8 @@ public function testLoginSuccessIgnoresTokensWhichDoNotContainAnUserInterfaceImp
public function testLoginSuccess()
{
$service = $this->getService(null, array('name' => 'foo', 'domain' => 'myfoodomain.foo', 'path' => '/foo/path', 'secure' => true, 'httponly' => true, 'lifetime' => 3600, 'always_remember_me' => true));
$request = new Request;
$response = new Response;
$request = new Request();
$response = new Response();

$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
Expand Down
Expand Up @@ -19,7 +19,7 @@ class JsonEncoderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
$this->encoder = new JsonEncoder;
$this->encoder = new JsonEncoder();
$this->serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder()));
}

Expand Down

0 comments on commit 077a089

Please sign in to comment.