Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / nikic / php-parser / test / PhpParser / Builder / UseTest.php
index adaeb3a5edaef899148639e930e3b518495a4d58..85c1d77dfc8c291ff9e09cddfc874a5f7244c59c 100644 (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);
     }
 }