for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Patsura Dmitry https://github.com/ovr <[email protected]>
*/
namespace Tests\PHPSA\Analyzer\Pass\Expression;
use PhpParser\Node\Expr\Array_;
use PHPSA\Analyzer\Pass\Expression\ArrayShortDefinition;
class ArrayShortDefinitionTest extends \Tests\PHPSA\TestCase
{
public function testLongDefintion()
$analyzer = new ArrayShortDefinition();
$result = $analyzer->pass(
new Array_(
[],
[
* $a = array();
'kind' => Array_::KIND_LONG
]
),
$this->getContext()
);
self::assertTrue($result);
}
public function testShortDefintion()
* $a = [];
'kind' => Array_::KIND_SHORT
self::assertFalse($result);