function testAddsApplicationNameIfApplicationInternalHeaderIsSet() { $request = new Request(); $request->setHeader('Asar-Internal-Application-Name', 'FooApp'); $filtered_request = $this->filter->filterRequest($request); $this->assertEquals('FooApp', $this->debug->get('Application')); }
function testSettingApplicationNameInInternalHeader() { $request = new Request(); $debug = new Debug(); $filter = $this->getMock('Asar\\RequestFilter\\RequestFilterInterface'); $request->setHeader('Asar-Internal-Debug', $debug); $filter->expects($this->once())->method('filterRequest')->with($request)->will($this->returnValue($request)); $this->routerReturnsResource(); $app = new Application('Some_Name', $this->router, $this->sm, $this->map, array($filter)); $app->handleRequest($request); $this->assertEquals('Some_Name', $debug->get('Application')); }