PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/nikic/php-parser/test/PhpParser/Node/Stmt/ClassConstTest.php

https://bitbucket.org/alan_cordova/api-sb-map
PHP | 35 lines | 26 code | 6 blank | 3 comment | 0 complexity | ed21f4f474691d12e03613e2691e86ef MD5 | raw file
 1<?php
 2
 3namespace PhpParser\Node\Stmt;
 4
 5class ClassConstTest extends \PHPUnit_Framework_TestCase
 6{
 7    /**
 8     * @dataProvider provideModifiers
 9     */
10    public function testModifiers($modifier) {
11        $node = new ClassConst(
12            array(), // invalid
13            constant('PhpParser\Node\Stmt\Class_::MODIFIER_' . strtoupper($modifier))
14        );
15
16        $this->assertTrue($node->{'is' . $modifier}());
17    }
18
19    public function testNoModifiers() {
20        $node = new ClassConst(array(), 0);
21
22        $this->assertTrue($node->isPublic());
23        $this->assertFalse($node->isProtected());
24        $this->assertFalse($node->isPrivate());
25        $this->assertFalse($node->isStatic());
26    }
27
28    public function provideModifiers() {
29        return array(
30            array('public'),
31            array('protected'),
32            array('private'),
33        );
34    }
35}