<commit_before><?php

namespace MaglLegacyApplicationTest;

use MaglLegacyApplication\Module;

/**
 * Description of ModuleTest
 *
 * @author matthias
 */
class ModuleTest extends \PHPUnit_Framework_TestCase
{

    /**
     *
     * @var Module
     */
    private $instance;

    public function setUp()
    {
        $this->instance = new Module();
    }

    public function testInstance()
    {
        $this->assertInstanceOf('MaglLegacyApplication\Module', $this->instance);
    }

    public function testConfigSerializable()
    {
        $config = $this->instance->getConfig();

        $this->assertEquals($config, unserialize(serialize($config)));
    }

    public function testGetAutoloaderConfig()
    {
        $config = $this->instance->getAutoloaderConfig();

        $this->assertTrue(array_key_exists('MaglLegacyApplication', $config['Zend\Loader\StandardAutoloader']['namespaces']));
    }

    public function testGetServiceFactories()
    {
        $config = $this->instance->getServiceConfig();

        $this->assertTrue(array_key_exists('factories', $config));
        $this->assertTrue(array_key_exists('MaglLegacyApplicationOptions', $config['factories']));
    }

    public function testGetControllerConfig()
    {
        $config = $this->instance->getControllerConfig();

        $this->assertTrue(array_key_exists('factories', $config));
        $this->assertTrue(array_key_exists('MaglLegacyApplication\Controller\Legacy', $config['factories']));
    }

    public function testGetControllerFromServiceManager()
    {

        $sm = Bootstrap::getServiceManager();

        $controller = $sm->get('ControllerLoader')->get('MaglLegacyApplication\Controller\Legacy');

        $this->assertInstanceOf('\MaglLegacyApplication\Controller\LegacyController', $controller);
    }

    public function testGetLegacyControllerOptionsFromServiceManager()
    {

        $sm = Bootstrap::getServiceManager();

        $options = $sm->get('MaglLegacyApplicationOptions');

        $this->assertInstanceOf('\MaglLegacyApplication\Options\LegacyControllerOptions', $options);
    }
}
<commit_msg>more detailed module tests<commit_after><?php

namespace MaglLegacyApplicationTest;

use MaglLegacyApplication\Module;

/**
 * Description of ModuleTest
 *
 * @author matthias
 */
class ModuleTest extends \PHPUnit_Framework_TestCase
{

    /**
     *
     * @var Module
     */
    private $instance;

    public function setUp()
    {
        $this->instance = new Module();
    }

    public function testInstance()
    {
        $this->assertInstanceOf('MaglLegacyApplication\Module', $this->instance);
    }

    public function testConfigSerializable()
    {
        $config = $this->instance->getConfig();

        $this->assertEquals($config, unserialize(serialize($config)));
    }

    public function testGetAutoloaderConfig()
    {
        $config = $this->instance->getAutoloaderConfig();

        $this->assertTrue(array_key_exists('MaglLegacyApplication', $config['Zend\Loader\StandardAutoloader']['namespaces']));
    }

    public function testGetServiceFactories()
    {
        $config = $this->instance->getServiceConfig();

        $this->assertTrue(array_key_exists('factories', $config));
        $this->assertTrue(array_key_exists('MaglLegacyApplicationOptions', $config['factories']));
    }

    public function testGetControllerConfig()
    {
        $config = $this->instance->getControllerConfig();

        $this->assertTrue(array_key_exists('factories', $config));
        $this->assertTrue(array_key_exists('MaglLegacyApplication\Controller\Legacy', $config['factories']));
    }

    /**
     * @covers MaglLegacyApplication\Module::getServiceConfig
     */
    public function testGetLegacyControllerOptionsFromServiceManager()
    {
//        $this->markTestSkipped();
        $sm = Bootstrap::getServiceManager();

        $options = $sm->get('MaglLegacyApplicationOptions');

        $this->assertInstanceOf('\MaglLegacyApplication\Options\LegacyControllerOptions', $options);
    }

    /**
     * @covers MaglLegacyApplication\Module::getControllerConfig
     */
    public function testGetControllerFromServiceManager()
    {
//$this->markTestSkipped();
        $sm = Bootstrap::getServiceManager();

        $controller = $sm->get('ControllerLoader')->get('MaglLegacyApplication\Controller\Legacy');

        $this->assertInstanceOf('\MaglLegacyApplication\Controller\LegacyController', $controller);
    }
}

{'fraction_non_alphanumeric': 0.13485663082437277, 'fraction_numerical': 0.0, 'mean_word_length': 3.6901260504201683, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, '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': '5442939', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1224, 'n_words': 167}