<commit_before><?php

namespace BoneTest\Http\Middleware;

use Bone\Http\Middleware\HalEntity;
use Codeception\TestCase\Test;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;
use Zend\Diactoros\ServerRequest;

class HalEntityTest extends Test
{
    private $fakeRequestHandler;

    public function before()
    {
        $this->fakeRequestHandler = new class implements RequestHandlerInterface {
            public function handle(ServerRequestInterface $request): ResponseInterface
            {
                return new JsonResponse(['drink' => 'grog', 'yo ho ho' => 'bottle of rum']);
            }
        }
    }

    /**
     * @throws \Exception
     */
    public function testProcesss()
    {
        $request = new ServerRequest();
        $halEntityMiddleware = new HalEntity();
        $response = $halEntityMiddleware->process($request, $this->fakeRequestHandler);
        $this->assertInstanceOf(ResponseInterface::class, $response);
//        echo $response->getBody()->getContents(); die;
    }
}<commit_msg>add semicolon :-P<commit_after><?php

namespace BoneTest\Http\Middleware;

use Bone\Http\Middleware\HalEntity;
use Codeception\TestCase\Test;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;
use Zend\Diactoros\ServerRequest;

class HalEntityTest extends Test
{
    private $fakeRequestHandler;

    public function before()
    {
        $this->fakeRequestHandler = new class implements RequestHandlerInterface {
            public function handle(ServerRequestInterface $request): ResponseInterface
            {
                return new JsonResponse(['drink' => 'grog', 'yo ho ho' => 'bottle of rum']);
            }
        };
    }

    /**
     * @throws \Exception
     */
    public function testProcesss()
    {
        $request = new ServerRequest();
        $halEntityMiddleware = new HalEntity();
        $response = $halEntityMiddleware->process($request, $this->fakeRequestHandler);
        $this->assertInstanceOf(ResponseInterface::class, $response);
//        echo $response->getBody()->getContents(); die;
    }
}
{'fraction_non_alphanumeric': 0.11409978308026031, 'fraction_numerical': 0.0, 'mean_word_length': 3.238970588235294, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5098251', 'n_tokens_mistral': 627, 'n_tokens_neox': 616, 'n_words': 132}