MvcLite\Request::getFormat
Gets a friendly version of the format.
Signature
public function getFormat(string
$contentType )
Parameters
$contentType
—
string
- The raw content type.
Returns
- string
- The machine friendly name for the request type (aka Format).
Test Coverage
Information
- Coverage: 10/10 Lines (100%)
- Tests: 8
- Passed: 8 (100%)
Tests
- [ PASSED ] — MvcLite\DispatcherTest::testDispatch with data set "good controller request"
- [ PASSED ] — MvcLite\DispatcherTest::testDispatch with data set "bad controller request"
- [ PASSED ] — MvcLite\RequestTest::testGetFormat with data set "application/json"
- [ PASSED ] — MvcLite\RequestTest::testGetFormat with data set "application/javascript"
- [ PASSED ] — MvcLite\RequestTest::testGetFormat with data set "text/html"
- [ PASSED ] — MvcLite\RequestTest::testGetFormat with data set "text/plain"
- [ PASSED ] — MvcLite\RequestTest::testGetFormat with data set "text/csv"
- [ PASSED ] — MvcLite\RequestTest::testGetFormat with data set "bad content type, expect exception"