<commit_before><?php

namespace spec\Tonic;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class ResourceMetadataSpec extends ObjectBehavior
{

    function it_is_initializable()
    {
        $this->beConstructedWith('\spec\Tonic\exampleClass');
        $this->shouldHaveType('Tonic\ResourceMetadata');
    }

    function it_should_retrieve_the_classes_uri()
    {
        $this->beConstructedWith('\spec\Tonic\exampleClass');
        $this->getUri()->shouldHaveCount(4);
        $this->getUri()[0]->shouldBe('/url1');
        $this->getUri(0)->shouldBe('/url1');
        $this->getUri(1)->shouldBe('/url2');
        $this->getUri(2)->shouldBe('/url3 /url4');
        $this->getUri(3)->shouldBe('/url5/([^/]+)');
        $this->getUri(4)->shouldBe(null);
    }

    function it_should_retrieve_the_classes_namespace_from_php()
    {
        $this->beConstructedWith('\spec\Tonic\exampleClass');
        $this->getNamespace()->shouldBe('spec\Tonic');
    }

    function it_should_retrieve_the_classes_namespace_from_doccomment()
    {<commit_msg>PHP5.3 compatible array access in ResourceMetadataSpec<commit_after><?php

namespace spec\Tonic;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class ResourceMetadataSpec extends ObjectBehavior
{

    function it_is_initializable()
    {
        $this->beConstructedWith('\spec\Tonic\exampleClass');
        $this->shouldHaveType('Tonic\ResourceMetadata');
    }

    function it_should_retrieve_the_classes_uri()
    {
        $this->beConstructedWith('\spec\Tonic\exampleClass');
        $this->getUri()->shouldHaveCount(4);
        $uris = $this->getUri();
        $uris[0]->shouldBe('/url1');
        $this->getUri(0)->shouldBe('/url1');
        $this->getUri(1)->shouldBe('/url2');
        $this->getUri(2)->shouldBe('/url3 /url4');
        $this->getUri(3)->shouldBe('/url5/([^/]+)');
        $this->getUri(4)->shouldBe(null);
    }

    function it_should_retrieve_the_classes_namespace_from_php()
    {
        $this->beConstructedWith('\spec\Tonic\exampleClass');
        $this->getNamespace()->shouldBe('spec\Tonic');
    }

    function it_should_retrieve_the_classes_namespace_from_doccomment()
    {
{'fraction_non_alphanumeric': 0.1662062615101289, 'fraction_numerical': 0.01289134438305709, 'mean_word_length': 3.5843881856540083, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '3611484', 'n_tokens_mistral': 703, 'n_tokens_neox': 700, 'n_words': 71}