Skip to content

Commit

Permalink
PSR-2 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Dec 2, 2014
1 parent 661be3b commit 94935ec
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Tests/CookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testInstantiationThrowsExceptionIfCookieNameContainsInvalidChara
*/
public function testInvalidExpiration()
{
$cookie = new Cookie('MyCookie', 'foo','bar');
$cookie = new Cookie('MyCookie', 'foo', 'bar');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/File/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function testMoveWithNonLatinName($filename, $sanitizedFilename)
copy(__DIR__.'/Fixtures/test.gif', $path);

$file = new File($path);
$movedFile = $file->move($targetDir,$filename);
$movedFile = $file->move($targetDir, $filename);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\File\File', $movedFile);

$this->assertTrue(file_exists($targetPath));
Expand Down
28 changes: 14 additions & 14 deletions Tests/HeaderBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,18 @@ public function testReplace()
public function testGet()
{
$bag = new HeaderBag(array('foo' => 'bar', 'fuzz' => 'bizz'));
$this->assertEquals( 'bar', $bag->get('foo'), '->get return current value');
$this->assertEquals( 'bar', $bag->get('FoO'), '->get key in case insensitive');
$this->assertEquals( array('bar'), $bag->get('foo', 'nope', false), '->get return the value as array');
$this->assertEquals('bar', $bag->get('foo'), '->get return current value');
$this->assertEquals('bar', $bag->get('FoO'), '->get key in case insensitive');
$this->assertEquals(array('bar'), $bag->get('foo', 'nope', false), '->get return the value as array');

// defaults
$this->assertNull($bag->get('none'), '->get unknown values returns null');
$this->assertEquals( 'default', $bag->get('none', 'default'), '->get unknown values returns default');
$this->assertEquals( array('default'), $bag->get('none', 'default', false), '->get unknown values returns default as array');
$this->assertEquals('default', $bag->get('none', 'default'), '->get unknown values returns default');
$this->assertEquals(array('default'), $bag->get('none', 'default', false), '->get unknown values returns default as array');

$bag->set('foo', 'bor', false);
$this->assertEquals( 'bar', $bag->get('foo'), '->get return first value');
$this->assertEquals( array('bar', 'bor'), $bag->get('foo', 'nope', false), '->get return all values as array');
$this->assertEquals('bar', $bag->get('foo'), '->get return first value');
$this->assertEquals(array('bar', 'bor'), $bag->get('foo', 'nope', false), '->get return all values as array');
}

public function testSetAssociativeArray()
Expand All @@ -125,16 +125,16 @@ public function testSetAssociativeArray()
public function testContains()
{
$bag = new HeaderBag(array('foo' => 'bar', 'fuzz' => 'bizz'));
$this->assertTrue( $bag->contains('foo', 'bar'), '->contains first value');
$this->assertTrue( $bag->contains('fuzz', 'bizz'), '->contains second value');
$this->assertFalse( $bag->contains('nope', 'nope'), '->contains unknown value');
$this->assertFalse( $bag->contains('foo', 'nope'), '->contains unknown value');
$this->assertTrue($bag->contains('foo', 'bar'), '->contains first value');
$this->assertTrue($bag->contains('fuzz', 'bizz'), '->contains second value');
$this->assertFalse($bag->contains('nope', 'nope'), '->contains unknown value');
$this->assertFalse($bag->contains('foo', 'nope'), '->contains unknown value');

// Multiple values
$bag->set('foo', 'bor', false);
$this->assertTrue( $bag->contains('foo', 'bar'), '->contains first value');
$this->assertTrue( $bag->contains('foo', 'bor'), '->contains second value');
$this->assertFalse( $bag->contains('foo', 'nope'), '->contains unknown value');
$this->assertTrue($bag->contains('foo', 'bar'), '->contains first value');
$this->assertTrue($bag->contains('foo', 'bor'), '->contains second value');
$this->assertFalse($bag->contains('foo', 'nope'), '->contains unknown value');
}

public function testCacheControlDirectiveAccessors()
Expand Down
4 changes: 2 additions & 2 deletions Tests/ParameterBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ public function testFilter()

$this->assertFalse($bag->filter('dec', '', false, FILTER_VALIDATE_INT, array(
'flags' => FILTER_FLAG_ALLOW_HEX,
'options' => array('min_range' => 1, 'max_range' => 0xff),)
'options' => array('min_range' => 1, 'max_range' => 0xff))
), '->filter() gets a value of parameter as integer between boundaries');

$this->assertFalse($bag->filter('hex', '', false, FILTER_VALIDATE_INT, array(
'flags' => FILTER_FLAG_ALLOW_HEX,
'options' => array('min_range' => 1, 'max_range' => 0xff),)
'options' => array('min_range' => 1, 'max_range' => 0xff))
), '->filter() gets a value of parameter as integer between boundaries');

$this->assertEquals(array('bang'), $bag->filter('array', '', false), '->filter() gets a value of parameter as an array');
Expand Down
4 changes: 2 additions & 2 deletions Tests/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function testCreate()
$this->assertEquals(80, $request->getPort());
$this->assertEquals('test.com', $request->getHttpHost());
$this->assertEquals('username', $request->getUser());
$this->assertSame('',$request->getPassword());
$this->assertSame('', $request->getPassword());
$this->assertFalse($request->isSecure());

$request = Request::create('http://test.com/?foo');
Expand Down Expand Up @@ -501,7 +501,7 @@ public function testGetUriForPath()

$request = new Request();

$request->initialize(array(), array(), array(), array(), array(),$server);
$request->initialize(array(), array(), array(), array(), array(), $server);

$this->assertEquals('http://host:8080/index.php/some/path', $request->getUriForPath('/some/path'), '->getUriForPath() with non default port');

Expand Down
2 changes: 1 addition & 1 deletion Tests/Session/Flash/FlashBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function testAll()
$this->bag->set('error', 'Bar');
$this->assertEquals(array(
'notice' => array('Foo'),
'error' => array('Bar'),), $this->bag->all()
'error' => array('Bar'), ), $this->bag->all()
);

$this->assertEquals(array(), $this->bag->all());
Expand Down

0 comments on commit 94935ec

Please sign in to comment.