c499058265e4e24ac477dc9530109ed037ad94eb
[yaffs-website] / Stmt / InterfaceTest.php
1 <?php
2
3 namespace PhpParser\Node\Stmt;
4
5 use PhpParser\Node;
6
7 class InterfaceTest extends \PHPUnit_Framework_TestCase
8 {
9     public function testGetMethods() {
10         $methods = array(
11             new ClassMethod('foo'),
12             new ClassMethod('bar'),
13         );
14         $interface = new Class_('Foo', array(
15             'stmts' => array(
16                 new Node\Stmt\ClassConst(array(new Node\Const_('C1', new Node\Scalar\String_('C1')))),
17                 $methods[0],
18                 new Node\Stmt\ClassConst(array(new Node\Const_('C2', new Node\Scalar\String_('C2')))),
19                 $methods[1],
20                 new Node\Stmt\ClassConst(array(new Node\Const_('C3', new Node\Scalar\String_('C3')))),
21             )
22         ));
23
24         $this->assertSame($methods, $interface->getMethods());
25     }
26 }