<commit_before><?php
/**
 * @author <NAME>
 */
namespace HealthCareAbroad\AdminBundle\Tests\Controller;

use HealthCareAbroad\AdminBundle\Tests\AdminBundleWebTestCase;

class InstitutionTreatmentsControllerTest extends AdminBundleWebTestCase
{
//     public function testPreExecute()
//     {
//         $uri = '/admin/institution/123123123123312312312312323231/medical-centers';
//         $client = $this->getBrowserWithActualLoggedInUser();
//         $client->request('GET', $uri);
//         $this->assertEquals(404, $client->getResponse()->getStatusCode(), 'Expected not found after invalid institutionId');
//     }
    
//     public function testViewAllMedicalCentersAction()
//     {
//         $invalidMethods = array('POST', 'PUT', 'DELETE');
//         $institution = $this->getDoctrine()->getRepository('InstitutionBundle:Institution')->find(1);
//         $uri = "/admin/institution/{$institution->getId()}/medical-centers";
//         $client = $this->getBrowserWithActualLoggedInUser();
        
//         // test invalid method access
//         foreach ($invalidMethods as $method) {
//             $client->request($method, $uri);
//             $this->assertEquals(405, $client->getResponse()->getStatusCode(), 'Expected method '.$method.' is invalid');
//         }
        
//         $crawler = $client->request('GET', $uri);
//         //echo $client->getResponse(); exit;
//         $this->assertEquals(200, $client->getResponse()->getStatusCode());
//         $this->assertGreaterThan(0, $crawler->filter('html:contains("' .$institution->getName(). ' Medical Centers")')->count(), '"Add Treatment" string not found!');
        
//     }
    
    public function testViewMedicalCenterAction()
    {
        $client = $this->getBrowserWithActualLoggedInUser();
        $institution = $this->getDoctrine()->getRepository('InstitutionBundle:Institution')->find(1);
        $uri = "/admin/institution/1/medical-center/view/2";
        $crawler = $client->request('GET', $uri);
        
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
    }<commit_msg>added functional test for viewMedicalCenter and viewAllMedicalCenters<commit_after><?php
/**
 * @author <NAME>
 */
namespace HealthCareAbroad\AdminBundle\Tests\Controller;

use HealthCareAbroad\AdminBundle\Tests\AdminBundleWebTestCase;

class InstitutionTreatmentsControllerTest extends AdminBundleWebTestCase
{
//     public function testPreExecute()
//     {
//         $uri = '/admin/institution/123123123123312312312312323231/medical-centers';
//         $client = $this->getBrowserWithActualLoggedInUser();
//         $client->request('GET', $uri);
//         $this->assertEquals(404, $client->getResponse()->getStatusCode(), 'Expected not found after invalid institutionId');
//     }
    
//     public function testViewAllMedicalCentersAction()
//     {
//         $invalidMethods = array('POST', 'PUT', 'DELETE');
//         $institution = $this->getDoctrine()->getRepository('InstitutionBundle:Institution')->find(1);
//         $uri = "/admin/institution/{$institution->getId()}/medical-centers";
//         $client = $this->getBrowserWithActualLoggedInUser();
        
//         // test invalid method access
//         foreach ($invalidMethods as $method) {
//             $client->request($method, $uri);
//             $this->assertEquals(405, $client->getResponse()->getStatusCode(), 'Expected method '.$method.' is invalid');
//         }
        
//         $crawler = $client->request('GET', $uri);
//         //echo $client->getResponse(); exit;
//         $this->assertEquals(200, $client->getResponse()->getStatusCode());
//         $this->assertGreaterThan(0, $crawler->filter('html:contains("' .$institution->getName(). ' Medical Centers")')->count(), '"Add Treatment" string not found!');
        
//     }
    
    public function testViewAllMedicalCentersAction()
    {
        $client = $this->getBrowserWithActualLoggedInUser();
        $crawler = $client->request('GET', '/admin/institution/1/medical-centers');
    
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
    }
    
    public function testViewMedicalCenterAction()
    {
        $client = $this->getBrowserWithActualLoggedInUser();
        $crawler = $client->request('GET', '/admin/institution/1/medical-center/view/1');
        
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
    }
{'fraction_non_alphanumeric': 0.17129316181448884, 'fraction_numerical': 0.021891220943353645, 'mean_word_length': 3.0810313075506444, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4158601', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1226, 'n_words': 192}