/** * @inheritdoc */ public function __construct(Configuration $configuration, LoggerInterface $logger, EventDispatcher $eventDispatcher, LoopInterface $loop) { parent::__construct($configuration, $logger, $eventDispatcher); $socket = new SocketServer($loop); $socket->listen($configuration->getHttpListenPort(), $configuration->getListenAddress()); // Configure the web server $webroot = realpath(__DIR__ . '/../../client/app'); $this->_staticWebServer = new StaticWebServer(new HttpServer($socket), $webroot, $logger); // Configure the authentication handler $this->_staticWebServer->setAuthenticationHandler(new BasicAuthenticationHandler('tvheadend-status-manager', [$this, 'validateCredentials'])); }
/** * @dataProvider dataProvider * * @param array $indexFiles * @param $requestPath * @param $resolvedPath * @param $contentType */ public function testGetContentType(array $indexFiles, $requestPath, $resolvedPath, $contentType) { $this->assertEquals($contentType, $this->staticWebServer->getContentType($resolvedPath)); }