<commit_before><?php

use Disclosure\Container;
use Disclosure\UnregisteredException;

require_once __DIR__.'/classes/test.php';

class MarkerTest extends PHPUnit_Framework_TestCase
{
    public function testMarkerInterfaceResolvesDependency()
    {
        Container::inject('Marker', function(&$bar) {
            $bar = new BasicInjection;
        });
        $foo = new ImplementsMarker;
        $this->assertInstanceOf('BasicInjection', $foo->bar);
    }

    public function testMarkerInterfaceDeep()
    {
        Container::inject('Marker', function(&$bar) {
            $bar = new BasicInjection;
        });
        $foo = new ImplementsDeepMarker;
        $this->assertInstanceOf('BasicInjection', $foo->bar);
    }

    public function testTraitResolvesDependency()
    {
        Container::inject('TraitDependency', function(&$bar) {
            $bar = new BasicInjection;
        });
        $foo = new UsesTrait;
        $this->assertInstanceOf('BasicInjection', $foo->bar);
    }
}
<commit_msg>implement gentry tests<commit_after><?php

namespace Disclosure\Test;

use Disclosure\UnregisteredException;
use Demo;

/**
 * @Description Markers should trigger injection
 */
class MarkerTest
{
    /**
     * @Description {0}::$bar is a BasicInjection
     */
    public function testMarkerInterfaceResolvesDependency(Demo\ImplementsMarker $foo)
    {
        return new Demo\BasicInjection;
    }

    /**
     * @Description {0}::$bar is deeply injected as BasicInjection
     */
    public function testMarkerInterfaceDeep(Demo\ImplementsDeepMarker $foo)
    {
        return new Demo\BasicInjection;
    }

    /**
     * @Description {0}::$bar is resolved by trait as BasicInjection
     */
    public function testTraitResolvesDependency(Demo\UsesTrait $foo)
    {
        return new Demo\BasicInjection;
    }
}

{'fraction_non_alphanumeric': 0.1119606772255598, 'fraction_numerical': 0.0016384489350081922, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5750361', 'n_tokens_mistral': 524, 'n_tokens_neox': 519, 'n_words': 107}