<commit_before><?php

namespace AppBundle\Tests\Controller;

class EmployeesControllerTest extends AbstractController
{
    public function testGetEmployees()
    {
        $this->request('/employees');
    }

    public function testGetEmployeesSlug()
    {
        $slug = $this->getEm()->getRepository('AppBundle:Employee')->findOneBy([])->getSlug();
        $this->request('/employees/'.$slug);
        $this->request('/employees/'.base_convert(md5(uniqid()), 11, 10), 'GET', 404);
    }

    public function testGetEmployeesSlugRoles()
    {
        $slug = $this->getEm()->getRepository('AppBundle:Employee')->findOneBy([])->getSlug();
        $this->request('/employees/'.$slug.'/roles');
        $this->request('/employees/'.base_convert(md5(uniqid()), 11, 10).'/roles', 'GET', 404);
    }
}<commit_msg>Added testEmployeesResponseFields<commit_after><?php

namespace AppBundle\Tests\Controller;

class EmployeesControllerTest extends AbstractController
{
    public function testGetEmployees()
    {
        $this->request('/employees');
    }

    public function testGetEmployeesSlug()
    {
        $slug = $this->getEm()->getRepository('AppBundle:Employee')->findOneBy([])->getSlug();
        $this->request('/employees/'.$slug);
        $this->request('/employees/'.base_convert(md5(uniqid()), 11, 10), 'GET', 404);
    }

    public function testGetEmployeesSlugRoles()
    {
        $slug = $this->getEm()->getRepository('AppBundle:Employee')->findOneBy([])->getSlug();
        $this->request('/employees/'.$slug.'/roles');
        $this->request('/employees/'.base_convert(md5(uniqid()), 11, 10).'/roles', 'GET', 404);
    }

    /**
     * @dataProvider providerEmployeesResponseFields
     */
    public function testEmployeesResponseFields($field)
    {
        $client = $this->getClient();

        $crawler = $client->request('GET', '/employees');

        $this->assertContains($field, $client->getResponse()->getContent());
    }

    public function providerEmployeesResponseFields()
    {
        return [
            ['employees'],
            ['first_name'],
            ['last_name'],
            ['middle_name'],
            ['dob'],
            ['position'],
            ['biography'],
            ['slug'],
            ['avatar'],
            ['reference'],
            ['employee_small'],
            ['employee_big'],
            ['url'],
            ['properties'],
            ['alt'],
            ['title'],
            ['src'],
            ['width'],
            ['height'],
            ['created_at'],
            ['updated_at'],
            ['page'],
            ['count'],
            ['total_count'],
            ['_links'],
            ['self'],
            ['first'],
            ['prev'],
            ['next'],
            ['last'],
            ['href'],
        ];
    }
}
{'fraction_non_alphanumeric': 0.18843151171043293, 'fraction_numerical': 0.0113555713271824, 'mean_word_length': 2.2703016241299303, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, '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': '6741185', 'n_tokens_mistral': 848, 'n_tokens_neox': 795, 'n_words': 114}