Normalize length of dividers
This commit is contained in:
parent
2d7db1ed83
commit
f542aaf3a9
|
|
@ -57,7 +57,7 @@ abstract class Message implements MessageInterface
|
|||
$this->headers = clone $this->headers;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Psr\Http\Message\MessageInterface
|
||||
|
||||
/**
|
||||
|
|
@ -266,7 +266,7 @@ abstract class Message implements MessageInterface
|
|||
return $message;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @param mixed $name
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Request extends Message implements RequestInterface
|
|||
/** @var UriInterface */
|
||||
protected $uri;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a new Request.
|
||||
|
|
@ -67,7 +67,7 @@ class Request extends Message implements RequestInterface
|
|||
parent::__clone();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Psr\Http\Message\RequestInterface
|
||||
|
||||
/**
|
||||
|
|
@ -214,7 +214,7 @@ class Request extends Message implements RequestInterface
|
|||
return $request;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @param mixed $method
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class Response extends Message implements ResponseInterface
|
|||
$this->reasonPhrase = $this->getDefaultReasonPhraseForStatusCode($statusCode);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Psr\Http\Message\ResponseInterface
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
/** @var array */
|
||||
private $uploadedFiles;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
public function __construct(array $serverParams = [])
|
||||
{
|
||||
|
|
@ -69,7 +69,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
parent::__clone();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Psr\Http\Message\ServerRequestInterface
|
||||
|
||||
/**
|
||||
|
|
@ -326,7 +326,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
return $request;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @param array $root
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class MethodMap
|
|||
/** @var array */
|
||||
private $map;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
public function __construct(DispatcherInterface $dispatcher)
|
||||
{
|
||||
|
|
@ -21,7 +21,7 @@ class MethodMap
|
|||
$this->dispatcher = $dispatcher;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// MethodMapInterface
|
||||
|
||||
/**
|
||||
|
|
@ -50,7 +50,7 @@ class MethodMap
|
|||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// MiddlewareInterface
|
||||
|
||||
/**
|
||||
|
|
@ -90,7 +90,7 @@ class MethodMap
|
|||
return $this->addAllowHeader($response);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
private function addAllowHeader(ResponseInterface $response): ResponseInterface
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class MessageTest extends TestCase
|
|||
);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Protocol Version
|
||||
|
||||
public function testGetProtocolVersionReturnsProtocolVersion1Point1ByDefault(): void
|
||||
|
|
@ -57,7 +57,7 @@ class MessageTest extends TestCase
|
|||
$this->assertEquals('1.0', $message->getProtocolVersion());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Headers
|
||||
|
||||
/**
|
||||
|
|
@ -223,7 +223,7 @@ class MessageTest extends TestCase
|
|||
$this->assertEquals($expected, $headers);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Body
|
||||
|
||||
public function testGetBodyReturnsEmptyStreamByDefault(): void
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use WellRESTed\Test\TestCase;
|
|||
|
||||
class RequestTest extends TestCase
|
||||
{
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Construction
|
||||
|
||||
public function testCreatesInstanceWithNoParameters(): void
|
||||
|
|
@ -52,7 +52,7 @@ class RequestTest extends TestCase
|
|||
$this->assertSame($body, $request->getBody());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Request Target
|
||||
|
||||
public function testGetRequestTargetPrefersExplicitRequestTarget(): void
|
||||
|
|
@ -83,7 +83,7 @@ class RequestTest extends TestCase
|
|||
$this->assertEquals('*', $request->getRequestTarget());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Method
|
||||
|
||||
public function testGetMethodReturnsGetByDefault(): void
|
||||
|
|
@ -119,7 +119,7 @@ class RequestTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Request URI
|
||||
|
||||
public function testGetUriReturnsEmptyUriByDefault(): void
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use WellRESTed\Test\TestCase;
|
|||
|
||||
class ResponseTest extends TestCase
|
||||
{
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Construction
|
||||
|
||||
public function testSetsStatusCodeOnConstruction(): void
|
||||
|
|
@ -30,7 +30,7 @@ class ResponseTest extends TestCase
|
|||
$this->assertSame($body, $response->getBody());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Status and Reason Phrase
|
||||
|
||||
public function testCreatesNewInstanceWithStatusCode(): void
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class ServerRequestMarshallerTest extends TestCase
|
|||
// -------------------------------------------------------------------------
|
||||
// Psr\Http\Message\RequestInterface
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Request Target
|
||||
|
||||
/**
|
||||
|
|
@ -145,7 +145,7 @@ class ServerRequestMarshallerTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Method
|
||||
|
||||
/**
|
||||
|
|
@ -172,7 +172,7 @@ class ServerRequestMarshallerTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// URI
|
||||
|
||||
/**
|
||||
|
|
@ -231,7 +231,7 @@ class ServerRequestMarshallerTest extends TestCase
|
|||
$this->assertEquals($_SERVER, $request->getServerParams());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Cookies
|
||||
|
||||
public function testProvidesCookieParams(): void
|
||||
|
|
@ -240,7 +240,7 @@ class ServerRequestMarshallerTest extends TestCase
|
|||
$this->assertEquals($_COOKIE, $request->getCookieParams());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Query
|
||||
|
||||
public function testProvidesQueryParams(): void
|
||||
|
|
@ -252,7 +252,7 @@ class ServerRequestMarshallerTest extends TestCase
|
|||
$this->assertEquals('aggie', $query['kitten']);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Uploaded Files
|
||||
|
||||
/**
|
||||
|
|
@ -354,7 +354,7 @@ class ServerRequestMarshallerTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Parsed Body
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use WellRESTed\Test\TestCase;
|
|||
|
||||
class ServerRequestTest extends TestCase
|
||||
{
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Server Params
|
||||
|
||||
public function testGetServerParamsReturnsEmptyArrayByDefault(): void
|
||||
|
|
@ -16,7 +16,7 @@ class ServerRequestTest extends TestCase
|
|||
$this->assertEquals([], $request->getServerParams());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Cookies
|
||||
|
||||
public function testGetCookieParamsReturnsEmptyArrayByDefault(): void
|
||||
|
|
@ -38,7 +38,7 @@ class ServerRequestTest extends TestCase
|
|||
$this->assertNotSame($request2, $request1);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Query
|
||||
|
||||
public function testGetQueryParamsReturnsEmptyArrayByDefault(): void
|
||||
|
|
@ -60,7 +60,7 @@ class ServerRequestTest extends TestCase
|
|||
$this->assertNotSame($request2, $request1);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Uploaded Files
|
||||
|
||||
public function testGetUploadedFilesReturnsEmptyArrayByDefault(): void
|
||||
|
|
@ -186,7 +186,7 @@ class ServerRequestTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Parsed Body
|
||||
|
||||
public function testGetParsedBodyReturnsNullByDefault(): void
|
||||
|
|
@ -243,7 +243,7 @@ class ServerRequestTest extends TestCase
|
|||
);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Attributes
|
||||
|
||||
public function testGetAttributesReturnsEmptyArrayByDefault(): void
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use WellRESTed\Test\TestCase;
|
|||
|
||||
class UriTest extends TestCase
|
||||
{
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Scheme
|
||||
|
||||
public function testDefaultSchemeIsEmpty(): void
|
||||
|
|
@ -43,7 +43,7 @@ class UriTest extends TestCase
|
|||
$uri->withScheme('gopher');
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Authority
|
||||
|
||||
public function testDefaultAuthorityIsEmpty(): void
|
||||
|
|
@ -168,7 +168,7 @@ class UriTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// User Info
|
||||
|
||||
public function testDefaultUserInfoIsEmpty(): void
|
||||
|
|
@ -202,7 +202,7 @@ class UriTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Host
|
||||
|
||||
public function testDefaultHostIsEmpty(): void
|
||||
|
|
@ -253,7 +253,7 @@ class UriTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Port
|
||||
|
||||
public function testDefaultPortWithNoSchemeIsNull(): void
|
||||
|
|
@ -320,7 +320,7 @@ class UriTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Path
|
||||
|
||||
public function testDefaultPathIsEmpty(): void
|
||||
|
|
@ -367,7 +367,7 @@ class UriTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Query
|
||||
|
||||
public function testDefaultQueryIsEmpty(): void
|
||||
|
|
@ -430,7 +430,7 @@ class UriTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Fragment
|
||||
|
||||
public function testDefaultFragmentIsEmpty(): void
|
||||
|
|
@ -473,7 +473,7 @@ class UriTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Concatenation
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class TemplateRouteTest extends TestCase
|
|||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
public function testReturnsPatternType()
|
||||
{
|
||||
|
|
@ -51,7 +51,7 @@ class TemplateRouteTest extends TestCase
|
|||
$this->assertSame(RouteInterface::TYPE_PATTERN, $route->getType());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Matching
|
||||
|
||||
/** @dataProvider nonMatchingTargetProvider */
|
||||
|
|
@ -71,7 +71,7 @@ class TemplateRouteTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Matching :: Simple Strings
|
||||
|
||||
/** @dataProvider simpleStringProvider */
|
||||
|
|
@ -100,7 +100,7 @@ class TemplateRouteTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Matching :: Reserved
|
||||
|
||||
/** @dataProvider reservedStringProvider */
|
||||
|
|
@ -127,7 +127,7 @@ class TemplateRouteTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Matching :: Label Expansion
|
||||
|
||||
/** @dataProvider labelWithDotPrefixProvider */
|
||||
|
|
@ -154,7 +154,7 @@ class TemplateRouteTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Matching :: Path Segments
|
||||
|
||||
/** @dataProvider pathSegmentProvider */
|
||||
|
|
@ -181,7 +181,7 @@ class TemplateRouteTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Matching :: Explosion
|
||||
|
||||
/** @dataProvider pathExplosionProvider */
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class RouterTest extends TestCase
|
|||
$this->next = new NextMock();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Construction
|
||||
|
||||
public function testCreatesInstance()
|
||||
|
|
@ -59,7 +59,7 @@ class RouterTest extends TestCase
|
|||
$this->assertNotNull($router);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Populating
|
||||
|
||||
public function testCreatesRouteForTarget()
|
||||
|
|
@ -84,7 +84,7 @@ class RouterTest extends TestCase
|
|||
$this->route->register('GET', 'middleware')->shouldHaveBeenCalled();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Dispatching
|
||||
|
||||
public function testDispatchesStaticRoute()
|
||||
|
|
@ -295,7 +295,7 @@ class RouterTest extends TestCase
|
|||
$this->route->matchesRequestTarget('/my/path')->shouldHaveBeenCalled();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Path Variables
|
||||
|
||||
/** @dataProvider pathVariableProvider */
|
||||
|
|
@ -366,7 +366,7 @@ class RouterTest extends TestCase
|
|||
)->shouldHaveBeenCalled();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// No Match
|
||||
|
||||
public function testWhenNoRouteMatchesByDefaultResponds404()
|
||||
|
|
@ -391,7 +391,7 @@ class RouterTest extends TestCase
|
|||
$this->assertTrue($this->next->called);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Middleware for Routes
|
||||
|
||||
public function testCallsRouterMiddlewareBeforeRouteMiddleware()
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class TransmitterTest extends TestCase
|
|||
$this->assertEquals($content, $captured);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// Preparation
|
||||
|
||||
public function testAddContentLengthHeader(): void
|
||||
|
|
|
|||
Loading…
Reference in New Issue