<commit_before><commit_msg>Inicio do teste de repository que vai ser usado para extrair o Request do Repository<commit_after><?php

namespace chegamos\entity\repository;

use chegamos\rest\Curl as RestClient;

class PlaceRepositoryTest extends \PHPUnit_Framework_TestCase
{
    public function testGetPlaceById()
    {
        $placeJson = <<<JSON
{"place": {
    "id":"UCV34B2P",
    "name":"<NAME> - S\u00E3o Paulo",
    "description": "Um bom restaurante",
    "review_count":"52",
    "average_rating":"4",
    "thumbs":{
        "total":"779",
        "up":"606"
    },
    "category":{
        "id":"67",
        "name":"RESTAURANTES",
        "subcategory":{
            "id":"95267",
            "name":"A Quilo "
        }
    },
    "address":{
        "street":"R Min. Jesuino Cardoso",
        "number":"473",
        "district":"Vila Olimpia",
        "zipcode":"00000000",
        "complement":"",
        "city":{
            "country":"BR",
            "state":"SP",
            "name":"Sao Paulo"
        }
    },
    "phone":{
        "country":"55",
        "area":"11",
        "number":"25793044"
    },
    "created":{
        "timestamp":"2007-08-01T00:00:00",
        "user":{
            "id":"1997653480",
            "name":"<NAME>",
            "photo_large_url":"http://aptuser.s3.amazonaws.com/1997653480_b.jpg",
            "photo_url":"http://aptuser.s3.amazonaws.com/1997653480_b.jpg",
            "photo_medium_url":"http://aptuser.s3.amazonaws.com/1997653480_m.jpg",
            "photo_small_url":"http://aptuser.s3.amazonaws.com/1997653480_s.jpg"
        }
    },
    "point":{
        "lat":"-23.59260829",
        "lng":"-46.68183288"
    },
    "main_url":"http://www.apontador.com.br/local/sp/sao_paulo/restaurantes/UCV34B2P/uziel_restaurante___sao_paulo.html",
    "icon_url":"http://img218.imageshack.us/img218/5889/logov2pv.jpg",
    "other_url":""
    }
}
JSON;
        $restClient = $this->getMock('RestClient', array("get"));
        $restClient->expects($this->any())
            ->method("get")
            ->will($this->returnValue($placeJson));

        $placeRepository = new PlaceRepository($restClient);
        $place = $placeRepository->get("8972911185");

        //@TODO: Continuar com tdd para extrair o que é request do repository
        //$this->assertEquals("", $placeRepository->getRequest());
    }
}

{'fraction_non_alphanumeric': 0.1813953488372093, 'fraction_numerical': 0.06638477801268498, 'mean_word_length': 2.428985507246377, 'pattern_counts': {'":': 44, '<': 9, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '3629555', 'n_tokens_mistral': 892, 'n_tokens_neox': 790, 'n_words': 111}