Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Fix CS issues
Browse files Browse the repository at this point in the history
- indentation, trailing speces
  • Loading branch information
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions test/Header/LocationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,72 +16,72 @@
class LocationTest extends \PHPUnit_Framework_TestCase
{

/**
* @paramstring $uri The URL to redirect to
* @dataProvider locationFromStringCreatesValidLocationHeaderProvider
*/
/**
* @paramstring $uri The URL to redirect to
* @dataProvider locationFromStringCreatesValidLocationHeaderProvider
*/
public function testLocationFromStringCreatesValidLocationHeader($uri)
{
$locationHeader = Location::fromString('Location: ' . $uri);
$this->assertInstanceOf('Zend\Http\Header\HeaderInterface', $locationHeader);
$this->assertInstanceOf('Zend\Http\Header\Location', $locationHeader);
}

public function locationFromStringCreatesValidLocationHeaderProvider()
{
return array(
array('http://www.example.com'),
array('https://www.example.com'),
array('mailto://www.example.com'),
array('file://www.example.com'),
);
return array(
array('http://www.example.com'),
array('https://www.example.com'),
array('mailto://www.example.com'),
array('file://www.example.com'),
);
}

/**
* Test that we can set a redirect to different URI-Schemes
*
*
* @param string $uri
* @param string $expectedClass
*
*
* @dataProvider locationCanSetDifferentSchemeUrisProvider
*/
public function testLocationCanSetDifferentSchemeUris($uri, $expectedClass)
{
$locationHeader = new Location;
$locationHeader->setUri($uri);
$this->assertAttributeInstanceof($expectedClass, 'uri', $locationHeader);
$locationHeader = new Location;
$locationHeader->setUri($uri);
$this->assertAttributeInstanceof($expectedClass, 'uri', $locationHeader);
}

/**
* Test that we can set a redirect to different URI-schemes via a class
*
*
* @param string $uri
* @param string $expectedClass
*
*
* @dataProvider locationCanSetDifferentSchemeUrisProvider
*/
public function testLocationCanSetDifferentSchemeUriObjects($uri, $expectedClass)
{
$uri = \Zend\Uri\UriFactory::factory($uri);
$locationHeader = new Location;
$locationHeader->setUri($uri);
$this->assertAttributeInstanceof($expectedClass, 'uri', $locationHeader);
$uri = \Zend\Uri\UriFactory::factory($uri);
$locationHeader = new Location;
$locationHeader->setUri($uri);
$this->assertAttributeInstanceof($expectedClass, 'uri', $locationHeader);

}

/**
* Provide data to the locationCanSetDifferentSchemeUris-test
*
*
* @return array
*/
public function locationCanSetDifferentSchemeUrisProvider()
{
return array(
array('http://www.example.com', '\Zend\Uri\Http'),
array('https://www.example.com', '\Zend\Uri\Http'),
array('mailto://www.example.com', '\Zend\Uri\Mailto'),
array('file://www.example.com', '\Zend\Uri\File'),
);
return array(
array('http://www.example.com', '\Zend\Uri\Http'),
array('https://www.example.com', '\Zend\Uri\Http'),
array('mailto://www.example.com', '\Zend\Uri\Mailto'),
array('file://www.example.com', '\Zend\Uri\File'),
);
}

public function testLocationGetFieldValueReturnsProperValue()
Expand Down

0 comments on commit 0800032

Please sign in to comment.