- $shell->setScopeVariables(compact('one', 'two', 'three', '__psysh__', '_', '_e', 'this'));
+ $shell->setScopeVariables(\compact('one', 'two', 'three', '__psysh__', '_', '_e', 'this'));
$this->assertNotContains('__psysh__', $shell->getScopeVariableNames());
$this->assertSame(['one', 'two', 'three', '_'], $shell->getScopeVariableNames());
$this->assertNotContains('__psysh__', $shell->getScopeVariableNames());
$this->assertSame(['one', 'two', 'three', '_'], $shell->getScopeVariableNames());
$this->assertSame($three, $shell->getScopeVariable('three'));
$this->assertNull($shell->getScopeVariable('_'));
$this->assertSame($three, $shell->getScopeVariable('three'));
$this->assertNull($shell->getScopeVariable('_'));
$shell->setScopeVariables([]);
$this->assertSame(['_'], $shell->getScopeVariableNames());
$shell->setScopeVariables([]);
$this->assertSame(['_'], $shell->getScopeVariableNames());
- $shell->setScopeVariables(compact('one', 'two', 'three', '__psysh__', '_', '_e', 'this'));
+ $shell->setScopeVariables(\compact('one', 'two', 'three', '__psysh__', '_', '_e', 'this'));
$shell->addInput('exit', true);
// This is super slow and we shouldn't do this :(
$shell->addInput('exit', true);
// This is super slow and we shouldn't do this :(
$this->assertContains('PHP Parse error', $streamContents);
$this->assertContains('message', $streamContents);
$this->assertContains('PHP Parse error', $streamContents);
$this->assertContains('message', $streamContents);
try {
$shell->handleError(E_USER_NOTICE, 'wheee', null, 13);
} catch (ErrorException $e) {
try {
$shell->handleError(E_USER_NOTICE, 'wheee', null, 13);
} catch (ErrorException $e) {
$this->assertContains('PHP Notice:', $streamContents);
$this->assertContains('wheee', $streamContents);
$this->assertContains('PHP Notice:', $streamContents);
$this->assertContains('wheee', $streamContents);
try {
$shell->handleError(E_USER_NOTICE, 'wheee', null, 13);
} catch (ErrorException $e) {
try {
$shell->handleError(E_USER_NOTICE, 'wheee', null, 13);
} catch (ErrorException $e) {
$this->assertInstanceOf('Symfony\Component\Console\Application', $shell);
$this->assertContains(Shell::VERSION, $shell->getVersion());
$this->assertInstanceOf('Symfony\Component\Console\Application', $shell);
$this->assertContains(Shell::VERSION, $shell->getVersion());
- $this->assertContains(phpversion(), $shell->getVersion());
- $this->assertContains(php_sapi_name(), $shell->getVersion());
+ $this->assertContains(PHP_VERSION, $shell->getVersion());
+ $this->assertContains(PHP_SAPI, $shell->getVersion());
$this->assertNotNull($code);
$this->assertSame('class a { } return new \\Psy\\CodeCleaner\\NoReturnValue();', $code);
}
$this->assertNotNull($code);
$this->assertSame('class a { } return new \\Psy\\CodeCleaner\\NoReturnValue();', $code);
}
$this->assertNotNull($code);
$this->assertSame('return 1 + 1 + 1;', $code);
}
$this->assertNotNull($code);
$this->assertSame('return 1 + 1 + 1;', $code);
}
$shell = new Shell($this->getConfig());
$shell->setOutput($output);
$this->assertEquals($expected, $shell->execute($input));
$shell = new Shell($this->getConfig());
$shell->setOutput($output);
$this->assertEquals($expected, $shell->execute($input));
$this->streams[] = $stream;
$output = new StreamOutput($stream, StreamOutput::VERBOSITY_NORMAL, false);
$this->streams[] = $stream;
$output = new StreamOutput($stream, StreamOutput::VERBOSITY_NORMAL, false);