update for version 1.0.1
This commit is contained in:
39
code/vendor/psy/psysh/test/Psy/Test/CodeCleanerTest.php
vendored
Normal file
39
code/vendor/psy/psysh/test/Psy/Test/CodeCleanerTest.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Psy Shell
|
||||
*
|
||||
* (c) 2012-2014 Justin Hileman
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Psy\Test;
|
||||
|
||||
use Psy\CodeCleaner;
|
||||
|
||||
class CodeCleanerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider codeProvider
|
||||
*/
|
||||
public function testAutomaticSemicolons(array $lines, $requireSemicolons, $expected)
|
||||
{
|
||||
$cc = new CodeCleaner();
|
||||
$this->assertEquals($expected, $cc->clean($lines, $requireSemicolons));
|
||||
}
|
||||
|
||||
public function codeProvider()
|
||||
{
|
||||
return array(
|
||||
array(array('true'), false, 'return true;'),
|
||||
array(array('true;'), false, 'return true;'),
|
||||
array(array('true;'), true, 'return true;'),
|
||||
array(array('true'), true, false),
|
||||
|
||||
array(array('echo "foo";', 'true'), false, "echo 'foo';\nreturn true;"),
|
||||
array(array('echo "foo";', 'true'), true , false),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user