<commit_before><?php
/**
 * Glovebox: Lightweight Dependency Injection Container
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2012 <NAME>
 * @license   http://github.com/sqmk/LICENSE.txt
 * @package   Glovebox
 */

/**
 * Glovebox Tests
 *
 * @package    Glovebox
 * @subpackage UnitTests
 * @group      Glovebox
 */
class GloveboxTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Glovebox container
     *
     * @var \Glovebox Container
     */
    protected $container;

    /**
     * Sets up fixture
     */
    public function setUp()
    {
        $this->container = new \Glovebox();
    }

    /**
     * Test: Service list
     *
     * @covers \Glovebox::getServices
     */
    public function testServiceList()
    {
        $this->assertEmpty(
            $this->container->getServices()
        );

        $this->container->dummy = function () {
            // Do nothing
        };

        $this->assertContains(
            'dummy',
            $this->container->getServices()
        );
    }

    /**
     * Test: Throw exception on invalid exception
     *
     * @coversNothing
     *
     * @expectedException PHPUnit_Framework_Error
     */
    public function testInvalidService()
    {
        $this->container->dummy = 'Invalid service';
    }

    /**
     * Test: Setting a service
     *
     * @covers \Glovebox::__set
     */
    public function testSettingService()
    {
        $this->container->dummy = function () {
            // Do nothing
        };
    }

    /**
     * Test: Throw exception on unknown service
     *
     * @coversNothing
     *
     * @expectedException        \DomainException
     * @expectedExceptionMessage Unknown service: dummy
     */
    public function testUnknownService()
    {
        $this->container->dummy;
    }
<commit_msg>Issue #5 - Check value on service to ensure set occurred.<commit_after><?php
/**
 * Glovebox: Lightweight Dependency Injection Container
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2012 <NAME>quires
 * @license   http://github.com/sqmk/LICENSE.txt
 * @package   Glovebox
 */

/**
 * Glovebox Tests
 *
 * @package    Glovebox
 * @subpackage UnitTests
 * @group      Glovebox
 */
class GloveboxTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Glovebox container
     *
     * @var \Glovebox Container
     */
    protected $container;

    /**
     * Sets up fixture
     */
    public function setUp()
    {
        $this->container = new \Glovebox();
    }

    /**
     * Test: Service list
     *
     * @covers \Glovebox::getServices
     */
    public function testServiceList()
    {
        $this->assertEmpty(
            $this->container->getServices()
        );

        $this->container->dummy = function () {
            // Do nothing
        };

        $this->assertContains(
            'dummy',
            $this->container->getServices()
        );
    }

    /**
     * Test: Throw exception on invalid exception
     *
     * @coversNothing
     *
     * @expectedException PHPUnit_Framework_Error
     */
    public function testInvalidService()
    {
        $this->container->dummy = 'Invalid service';
    }

    /**
     * Test: Setting a service
     *
     * @covers \Glovebox::__set
     */
    public function testSettingService()
    {
        $this->container->dummy = function () {
            return 'success';
        };

        $this->assertEquals(
            'success',
            $this->container->dummy
        );
    }

    /**
     * Test: Throw exception on unknown service
     *
     * @coversNothing
     *
     * @expectedException        \DomainException
     * @expectedExceptionMessage Unknown service: dummy
     */
    public function testUnknownService()
    {
        $this->container->dummy;
    }

{'fraction_non_alphanumeric': 0.12296374146085129, 'fraction_numerical': 0.002364687335785602, 'mean_word_length': 1.8368107302533532, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 44, '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': '7521142', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1069, 'n_words': 228}