<commit_before><?php

namespace Application\Bundle\DefaultBundle\Tests\Controller;

use Liip\FunctionalTestBundle\Test\WebTestCase;

/**
 * Test cases for DefaultContoller
 *
 * @author <NAME> <<EMAIL>>
 */
class DefaultControllerTest extends WebTestCase
{

    public function testHomePage()
    {
        $this->loadFixtures(array(
            'Application\Bundle\UserBundle\DataFixtures\ORM\LoadUserData',
            'Stfalcon\Bundle\PortfolioBundle\DataFixtures\ORM\LoadCategoryData',
            'Stfalcon\Bundle\PortfolioBundle\DataFixtures\ORM\LoadProjectData',
        ));

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

        // check responce
        $this->assertTrue($client->getResponse()->isSuccessful());

        // check link to category view
        $url = $this->getUrl('portfolio_all_projects');
        $this->assertCount(2, $crawler->filter('a[href="' . $url . '"]'));

        // check links to view projects on homepage
        $preorderUrl = $this->getUrl('portfolio_project_view',
            array('categorySlug' => 'web-development', 'projectSlug' => 'preorder-it')
        );
        $this->assertCount(1, $crawler->filter('.projects li a[href="' . $preorderUrl . '"]'));

        $epriceUrl = $this->getUrl('portfolio_project_view',
            array('categorySlug' => 'web-development', 'projectSlug' => 'eprice-kz')
        );
        $this->assertCount(1, $crawler->filter('.projects li a[href="' . $epriceUrl . '"]'));
    }

    public function testContactPage()
    {
        $client = $this->createClient();
        $crawler = $client->request('GET', $this->getUrl('contacts', array()));

        // check responce
        $this->assertTrue($client->getResponse()->isSuccessful());
        // check phone number
        $this->assertCount(1, $crawler->filter('section.contacts-wrapper .info-group a:contains("+380 96 057-81-61")'));
        // check e-mail
        $this->assertCount(1, $crawler->filter('section.contacts-wrapper .info-group a:contains("<EMAIL>")'));
    }

}<commit_msg>Fix test for contacts page<commit_after><?php

namespace Application\Bundle\DefaultBundle\Tests\Controller;

use Liip\FunctionalTestBundle\Test\WebTestCase;

/**
 * Test cases for DefaultContoller
 *
 * @author <NAME> <<EMAIL>>
 */
class DefaultControllerTest extends WebTestCase
{

    public function testHomePage()
    {
        $this->loadFixtures(array(
            'Application\Bundle\UserBundle\DataFixtures\ORM\LoadUserData',
            'Stfalcon\Bundle\PortfolioBundle\DataFixtures\ORM\LoadCategoryData',
            'Stfalcon\Bundle\PortfolioBundle\DataFixtures\ORM\LoadProjectData',
        ));

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

        // check responce
        $this->assertTrue($client->getResponse()->isSuccessful());

        // check link to category view
        $url = $this->getUrl('portfolio_all_projects');
        $this->assertCount(2, $crawler->filter('a[href="' . $url . '"]'));

        // check links to view projects on homepage
        $preorderUrl = $this->getUrl('portfolio_project_view',
            array('categorySlug' => 'web-development', 'projectSlug' => 'preorder-it')
        );
        $this->assertCount(1, $crawler->filter('.projects li a[href="' . $preorderUrl . '"]'));

        $epriceUrl = $this->getUrl('portfolio_project_view',
            array('categorySlug' => 'web-development', 'projectSlug' => 'eprice-kz')
        );
        $this->assertCount(1, $crawler->filter('.projects li a[href="' . $epriceUrl . '"]'));
    }

    public function testContactPage()
    {
        $client = $this->createClient();
        $crawler = $client->request('GET', $this->getUrl('contacts', array()));

        // check responce
        $this->assertTrue($client->getResponse()->isSuccessful());
        // check phone number
        $this->assertCount(1, $crawler->filter('section.contacts-wrapper .info-group a:contains("+380 67 33-44-040")'));
        // check e-mail
        $this->assertCount(1, $crawler->filter('section.contacts-wrapper .info-group a:contains("<EMAIL>")'));
    }

}
{'fraction_non_alphanumeric': 0.1712773634832812, 'fraction_numerical': 0.008178975222516238, 'mean_word_length': 3.0329776915615905, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 69, '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': '6819447', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1232, 'n_words': 196}