diff --git a/src/App.php b/src/App.php index ef147c0..a81926e 100644 --- a/src/App.php +++ b/src/App.php @@ -621,6 +621,6 @@ class App $this->router->cache(); - $this->logger->info('ROUTE_CACHE miss.'); + //$this->logger->info('ROUTE_CACHE miss.'); } } diff --git a/src/Router/Router.php b/src/Router/Router.php index 58f88c4..5dedbc9 100644 --- a/src/Router/Router.php +++ b/src/Router/Router.php @@ -166,7 +166,7 @@ class Router try { $this->cachePoolChain->save($routeItem); - $this->logger->info('Cached router to cache pool'); + //$this->logger->info('Cached router to cache pool'); } catch (CachePoolException $cachePoolException) { $this->logger->critical('Cache Pool Exception: '.$cachePoolException->getMessage()); } diff --git a/src/Workers/WaitForEmitWorker.php b/src/Workers/WaitForEmitWorker.php index c017189..454cea3 100644 --- a/src/Workers/WaitForEmitWorker.php +++ b/src/Workers/WaitForEmitWorker.php @@ -35,12 +35,6 @@ abstract class WaitForEmitWorker extends AbstractWorker return $this; } - public function run(): void - { - $this->logger->debug('Running Emit Worker'); - $this->redis->listen([$this, 'recv']); - } - public function recv($redis, $pattern, $chan, $msg): void { $json = json_decode($msg, true); @@ -51,5 +45,7 @@ abstract class WaitForEmitWorker extends AbstractWorker public function iterate(): bool { + $this->logger->debug('Running Emit Worker'); + $this->redis->listen([$this, 'recv']); } } diff --git a/tests/AbstractRoutesTestCase.php b/tests/AbstractRoutesTestCase.php index 857f77f..31dc5d1 100644 --- a/tests/AbstractRoutesTestCase.php +++ b/tests/AbstractRoutesTestCase.php @@ -3,7 +3,10 @@ namespace Benzine\Tests; use Benzine\Tests\Traits\AppTestTrait; +use GuzzleHttp\Psr7\Utils; +use Middlewares\Utils\Factory as MiddlewareFactory; use Psr\Http\Message\ResponseInterface; +use Slim\Psr7\Request; abstract class AbstractRoutesTestCase extends AbstractBaseTestCase { @@ -31,6 +34,7 @@ abstract class AbstractRoutesTestCase extends AbstractBaseTestCase bool $isJsonRequest = true, array $extraHeaders = [] ): ResponseInterface { + /** @var Request $request */ $request = $this->createRequest($method, $path); if ($isJsonRequest) { @@ -38,8 +42,10 @@ abstract class AbstractRoutesTestCase extends AbstractBaseTestCase $dataOrPost = json_decode(json_encode($dataOrPost), true); $request = $request->withParsedBody($dataOrPost); } - $request = $request->withHeader('Content-Type', 'application/json'); + }else{ + $request->getBody()->write($dataOrPost); + $request->getBody()->rewind(); } foreach($extraHeaders as $key => $value){