<commit_before><?php

namespace Neptune\Tests\Command;

require_once __DIR__ . '/../../../bootstrap.php';

use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Console\Application;

use Neptune\Core\Config;
use Neptune\Core\Neptune;
use Neptune\Command\EnvListCommand;
use Neptune\Console\Console;

use Temping\Temping;

/**
 * EnvListCommandTest
 *
 * @author <NAME> <<EMAIL>>
 **/
class EnvListCommandTest extends \PHPUnit_Framework_TestCase {

	protected $tester;
	protected $temping;
	protected $config;
    protected $neptune;

	public function setup() {
		$this->config = Config::create('neptune');

		$this->temping = new Temping();
		$this->temping->createDirectory('config/env');
		$this->config->set('dir.root', $this->temping->getDirectory());
        $this->neptune = new Neptune($this->config);

		$application = new Application();
		$application->add(new EnvListCommand($this->neptune, $this->config));
		$command = $application->find('env:list');
		$this->tester = new CommandTester($command);
	}

	public function tearDown() {
		$this->temping->reset();
	}

	public function testListNoEnvs() {
		$this->tester->execute(array());
		$this->assertSame('', $this->tester->getDisplay());
	}

	public function testListOneEnv() {
		$this->temping->create('config/env/development.php');
		$this->tester->execute(array());
		$this->assertSame("development\n", $this->tester->getDisplay(true));
	}

	public function testListMultipleEnvs() {
		//create a mock project folder containing some stub config files
		$this->temping->create('config/env/production.php');
		$this->temping->create('config/env/development.php');
		$this->tester->execute(array());
		$this->assertSame("development\nproduction\n", $this->tester->getDisplay(true));
	}

	public function testCurrentEnvHighlighted() {
		//set the Console helper within EnvListCommand to give raw
		//output so we can look at the <tags>
		Console::outputRaw();
		$this->config->set('env', 'production');
		$this->temping->create('config/env/production.php');
		$this->temping->create('config/env/development.php');
		$this->tester->execute(array());
		$expected = "development\n<info>production</info>\n";
		$this->assertSame($expected, $this->tester->getDisplay(true));
	}

}
<commit_msg>Updating EnvListCommandTest for new Config syntax<commit_after><?php

namespace Neptune\Tests\Command;

require_once __DIR__ . '/../../../bootstrap.php';

use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Console\Application;

use Neptune\Config\NeptuneConfig;
use Neptune\Core\Neptune;
use Neptune\Command\EnvListCommand;
use Neptune\Console\Console;

use Temping\Temping;

/**
 * EnvListCommandTest
 *
 * @author <NAME> <<EMAIL>>
 **/
class EnvListCommandTest extends \PHPUnit_Framework_TestCase {

	protected $tester;
	protected $temping;
	protected $config;
    protected $neptune;

	public function setup() {

		$this->temping = new Temping();
		$this->temping->createDirectory('config/env');
		$this->config = new NeptuneConfig($this->temping->getDirectory(), false);
        $this->neptune = new Neptune($this->config);

		$application = new Application();
		$application->add(new EnvListCommand($this->neptune, $this->config));
		$command = $application->find('env:list');
		$this->tester = new CommandTester($command);
	}

	public function tearDown() {
		$this->temping->reset();
	}

	public function testListNoEnvs() {
		$this->tester->execute(array());
		$this->assertSame('', $this->tester->getDisplay());
	}

	public function testListOneEnv() {
		$this->temping->create('config/env/development.php');
		$this->tester->execute(array());
		$this->assertSame("development\n", $this->tester->getDisplay(true));
	}

	public function testListMultipleEnvs() {
		//create a mock project folder containing some stub config files
		$this->temping->create('config/env/production.php');
		$this->temping->create('config/env/development.php');
		$this->tester->execute(array());
		$this->assertSame("development\nproduction\n", $this->tester->getDisplay(true));
	}

	public function testCurrentEnvHighlighted() {
		//set the Console helper within EnvListCommand to give raw
		//output so we can look at the <tags>
		Console::outputRaw();
		$this->config->set('env', 'production');
		$this->temping->create('config/env/production.php');
		$this->temping->create('config/env/development.php');
		$this->tester->execute(array());
		$expected = "development\n<info>production</info>\n";
		$this->assertSame($expected, $this->tester->getDisplay(true));
	}

}

{'fraction_non_alphanumeric': 0.17751869775626924, 'fraction_numerical': 0.0, 'mean_word_length': 5.186394557823129, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 111, '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': '2761893', 'n_tokens_mistral': 1534, 'n_tokens_neox': 1444, 'n_words': 257}