<commit_before><?php

namespace CultuurNet\UDB3\UDB2\XML;

class XMLValidationServiceCollectionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @test
     */
    public function it_stores_an_array_of_xml_validation_services()
    {
        $xmlValidationService1 = $this->createMock(XMLValidationServiceInterface::class);
        $xmlValidationService2 = $this->createMock(XMLValidationServiceInterface::class);

        $xmlValidationServiceCollection = new XMLValidationServiceCollection(
            $xmlValidationService1,
            $xmlValidationService2
        );

        $this->assertEquals(
            [
                $xmlValidationService1,
                $xmlValidationService2
            ],
            $xmlValidationServiceCollection->getXmlValidationServices()
        );
    }

    /**
     * @test
     */
    public function it_requires_xml_validation_services_interfaces()
    {
        $xmlValidationService = $this->createMock(XMLValidationServiceInterface::class);
        $somethingElse = $this->createMock(\Exception::class);

        if (interface_exists(\Throwable::class)) {
            $this->expectException(\Throwable::class);
        } else {
            $this->expectException(\Exception::class);
        }

        new XMLValidationServiceCollection(
            $xmlValidationService,
            $somethingElse
        );
    }
}<commit_msg>III-2345 Does it catch PHPUnit_Framework_Error?<commit_after><?php

namespace CultuurNet\UDB3\UDB2\XML;

class XMLValidationServiceCollectionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @test
     */
    public function it_stores_an_array_of_xml_validation_services()
    {
        $xmlValidationService1 = $this->createMock(XMLValidationServiceInterface::class);
        $xmlValidationService2 = $this->createMock(XMLValidationServiceInterface::class);

        $xmlValidationServiceCollection = new XMLValidationServiceCollection(
            $xmlValidationService1,
            $xmlValidationService2
        );

        $this->assertEquals(
            [
                $xmlValidationService1,
                $xmlValidationService2
            ],
            $xmlValidationServiceCollection->getXmlValidationServices()
        );
    }

    /**
     * @test
     */
    public function it_requires_xml_validation_services_interfaces()
    {
        $xmlValidationService = $this->createMock(XMLValidationServiceInterface::class);
        $somethingElse = $this->createMock(\Exception::class);

        if (interface_exists(\Throwable::class)) {
            $this->expectException(\Throwable::class);
        } else {
            $this->expectException(\PHPUnit_Framework_Error::class);
        }

        new XMLValidationServiceCollection(
            $xmlValidationService,
            $somethingElse
        );
    }
}
{'fraction_non_alphanumeric': 0.096045197740113, 'fraction_numerical': 0.007062146892655367, 'mean_word_length': 2.6135204081632653, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 24}, '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': '3306432', 'n_tokens_mistral': 727, 'n_tokens_neox': 705, 'n_words': 86}