<commit_before><?php
/*
 * This file is part of the CLIFramework package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 */
namespace tests\CLIFramework\Extension;
use CLIFramework\Extension\DaemonExtension;
use CLIFramework\Command;
use CLIFramework\Application;
use CLIFramework\ServiceContainer;
use PHPUnit_Framework_TestCase;

class DaemonExtensionTest extends PHPUnit_Framework_TestCase 
{
    private $extension;

    private $command;

    public function setUp()
    {
        if (!DaemonExtension::isAvailable()) {
            $this->markTestSkipped('DaemonExtension is not available.');
        }
        $this->extension = new DaemonExtensionForTest(new ServiceContainer);
        $this->extension->noDetach();
        $this->command = new DaemonExtensionTestCommand();

        // Setup a new application
        $this->command->setApplication(new Application());
        $this->command->_init();
        $this->extension->bindCommand($this->command);
    }

    public function testRun()
    {
        $this->assertTrue(true);
        // $this->assertFalse(file_exists($this->extension->getPidFilePath()));
    }

    public function tearDown()
    {
    }
}

class DaemonExtensionForTest extends DaemonExtension
{
    public function noDetach()
    {
        parent::noDetach();
    }
}

class DaemonExtensionTestCommand extends Command
{
    public function execute()
    {
    }
}
<commit_msg>Let ExtensionException accept Extension object to provide more debug info.<commit_after><?php
/*
 * This file is part of the CLIFramework package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 */
namespace tests\CLIFramework\Extension;
use CLIFramework\Extension\DaemonExtension;
use CLIFramework\Command;
use CLIFramework\Application;
use CLIFramework\ServiceContainer;
use PHPUnit_Framework_TestCase;

class DaemonExtensionTest extends PHPUnit_Framework_TestCase 
{
    private $extension;

    private $command;

    public function setUp()
    {
        $this->extension = new DaemonExtensionForTest(new ServiceContainer);
        if (!$this->extension->isAvailable()) {
            $this->markTestSkipped('DaemonExtension is not available.');
        }
        $this->extension->noDetach();

        $this->command = new DaemonExtensionTestCommand();

        // Setup a new application
        $this->command->setApplication(new Application());
        $this->command->_init();
        $this->extension->bindCommand($this->command);
    }

    public function testRun()
    {
        $this->assertTrue(true);
        // $this->assertFalse(file_exists($this->extension->getPidFilePath()));
    }

    public function tearDown()
    {
    }
}

class DaemonExtensionForTest extends DaemonExtension
{
    public function noDetach()
    {
        parent::noDetach();
    }
}

class DaemonExtensionTestCommand extends Command
{
    public function execute()
    {
    }
}

{'fraction_non_alphanumeric': 0.10993249758919961, 'fraction_numerical': 0.0, 'mean_word_length': 3.298342541436464, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2555004', 'n_tokens_mistral': 840, 'n_tokens_neox': 849, 'n_words': 207}