Laravel version update

Laravel version update
This commit is contained in:
Manish Verma
2018-08-06 18:48:58 +05:30
parent d143048413
commit 126fbb0255
13678 changed files with 1031482 additions and 778530 deletions

View File

@@ -1,10 +1,11 @@
<?php
<?php declare(strict_types=1);
use PhpParser\Builder;
use PhpParser\Node\Name;
use PhpParser\Node\Stmt;
use PHPUnit\Framework\TestCase;
class UseTest extends \PHPUnit_Framework_TestCase
class UseTest extends TestCase
{
protected function createUseBuilder($name, $type = Stmt\Use_::TYPE_NORMAL) {
return new Builder\Use_($name, $type);
@@ -12,24 +13,18 @@ class UseTest extends \PHPUnit_Framework_TestCase
public function testCreation() {
$node = $this->createUseBuilder('Foo\Bar')->getNode();
$this->assertEquals(new Stmt\Use_(array(
new Stmt\UseUse(new Name('Foo\Bar'), 'Bar')
)), $node);
$this->assertEquals(new Stmt\Use_([
new Stmt\UseUse(new Name('Foo\Bar'), null)
]), $node);
$node = $this->createUseBuilder(new Name('Foo\Bar'))->as('XYZ')->getNode();
$this->assertEquals(new Stmt\Use_(array(
$this->assertEquals(new Stmt\Use_([
new Stmt\UseUse(new Name('Foo\Bar'), 'XYZ')
)), $node);
]), $node);
$node = $this->createUseBuilder('foo\bar', Stmt\Use_::TYPE_FUNCTION)->as('foo')->getNode();
$this->assertEquals(new Stmt\Use_(array(
$this->assertEquals(new Stmt\Use_([
new Stmt\UseUse(new Name('foo\bar'), 'foo')
), Stmt\Use_::TYPE_FUNCTION), $node);
}
public function testNonExistingMethod() {
$this->setExpectedException('LogicException', 'Method "foo" does not exist');
$builder = $this->createUseBuilder('Test');
$builder->foo();
], Stmt\Use_::TYPE_FUNCTION), $node);
}
}