<commit_before><?php

namespace Tests\AppBundle\Controller;

use Liip\FunctionalTestBundle\Test\WebTestCase;

class BioControllerControllerControllerTest extends WebTestCase
{

    private $helper;

    protected function setUp()
    {
        $this->helper = new ControllerHelperMethods();
        $this->helper->loadTestFixtures();
        $this->loginAs($this->helper->fixtures->getReference('Stuart.Bradley'), 'main');
    }

    public function testGetBioControlSample()
    {
        $helper = $this->helper;
        $client = $this->makeClient();

        $payload = ['sample_number' => 67655];
        $client->request(
            'POST',
            "/bio_control/sample",
            $payload,
            [],
            ['HTTP_Content-Type' => 'application/json']
        );

        $this->assertStatusCode(200, $client);
    }
}<commit_msg>Updated BioControl JSON request test.<commit_after><?php

namespace Tests\AppBundle\Controller;

use Liip\FunctionalTestBundle\Test\WebTestCase;

class BioControllerControllerControllerTest extends WebTestCase
{

    private $helper;

    protected function setUp()
    {
        $this->helper = new ControllerHelperMethods();
        $this->helper->loadTestFixtures();
        $this->loginAs($this->helper->fixtures->getReference('Stuart.Bradley'), 'main');
    }

    public function testGetBioControlSample()
    {
        $helper = $this->helper;
        $client = $this->makeClient();

        $crawler = $client->request(
            'POST',
            "/bio_control/sample",
            array('sample_number' => 67655),
            array(),
            array('HTTP_Content-Type' => 'application/json')
        );

        $JSON_response = json_decode($client->getResponse()->getContent(), true);

        $this->assertStatusCode(200, $client);
        $this->assertNotEmpty($JSON_response);

        $this->assertEquals($JSON_response["code"], 100);
        $this->assertEquals($JSON_response["success"], true);
        $this->assertEquals($JSON_response["sample_number"], 67655);
    }
}
{'fraction_non_alphanumeric': 0.14480741101901512, 'fraction_numerical': 0.011701608971233545, 'mean_word_length': 2.828358208955224, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '5523573', 'n_tokens_mistral': 585, 'n_tokens_neox': 553, 'n_words': 90}