<commit_before><?php

class ApiTest extends TestCase {

    /**
     * Test search api endpoint.
     *
     * @return void
     * */
    public function testSearch()
    {
        $this->call('GET', '/api/search/chicken');

        $this->assertResponseOk();
    }

    public function testSearchResults()
    {
        $response = $this->call('GET', '/api/search/chicken');

        var_dump(json_decode($response->getContent()));

        die();

        $this->assertResponseOk();
    }
<commit_msg>Adding new test for intial API endpoint<commit_after><?php

class ApiTest extends TestCase {

    /**
     * Test search api endpoint.
     *
     * @return void
     * */
    public function testSearch()
    {
        $this->call('GET', '/api/search/chicken');

        $this->assertResponseOk();
    }

    /**
     * Test call to the search API with input with no match on a food.
     *
     * @return void
     */
    public function testSearchResultsNoFoodFound()
    {
        $response = $this->call('GET', '/api/search/chicken');

        $this->assertResponseOk();

        $results = json_decode($response->getContent());

        $this->assertNull($results->food);
        $this->assertEquals('chicken', $results->searchInput);
        $this->assertEquals(' is not allowed on the Slow Carb Diet', $results->message);
        $this->assertNull($results->similarFoodName);
    }

    /**
     * Test call to the search API with input with a match on a food.
     *
     * @return void
     */
    public function testSearchResultsFoodFound()
    {
        $response = $this->call('GET', '/api/search/AllowedFood');

        $this->assertResponseOk();

        $results = json_decode($response->getContent());

        var_dump($results);
        die();

        $this->assertTrue($results->food->allowed);

        $this->assertEquals('AllowedFood', $results->searchInput);
        $this->assertEquals(' is allowed on the Slow Carb Diet', $results->message);
        $this->assertNull($results->similarFoodName);
    }


{'fraction_non_alphanumeric': 0.15051647811116575, 'fraction_numerical': 0.0, 'mean_word_length': 2.4242424242424243, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '4980072', 'n_tokens_mistral': 587, 'n_tokens_neox': 563, 'n_words': 128}