Code Duplication    Length = 8-9 lines in 4 locations

tests/LuaParserTest.php 4 locations

@@ 20-28 (lines=9) @@
17
use Vlaswinkel\Lua\LuaTokenStream;
18
19
class LuaParserTest extends \PHPUnit_Framework_TestCase {
20
    public function testString() {
21
        $parser = new LuaParser(new LuaTokenStream(new LuaInputStream('"foo"')));
22
23
        $node = $parser->parse();
24
25
        $this->assertEquals(StringASTNode::NAME, $node->getName());
26
        $this->assertInstanceOf(StringASTNode::class, $node);
27
        $this->assertEquals("foo", $node->getValue());
28
    }
29
30
    public function testNumber() {
31
        $parser = new LuaParser(new LuaTokenStream(new LuaInputStream('1337')));
@@ 30-38 (lines=9) @@
27
        $this->assertEquals("foo", $node->getValue());
28
    }
29
30
    public function testNumber() {
31
        $parser = new LuaParser(new LuaTokenStream(new LuaInputStream('1337')));
32
33
        $node = $parser->parse();
34
35
        $this->assertEquals(NumberASTNode::NAME, $node->getName());
36
        $this->assertInstanceOf(NumberASTNode::class, $node);
37
        $this->assertEquals(1337, $node->getValue());
38
    }
39
40
    public function testNil() {
41
        $parser = new LuaParser(new LuaTokenStream(new LuaInputStream('nil')));
@@ 40-47 (lines=8) @@
37
        $this->assertEquals(1337, $node->getValue());
38
    }
39
40
    public function testNil() {
41
        $parser = new LuaParser(new LuaTokenStream(new LuaInputStream('nil')));
42
43
        $node = $parser->parse();
44
45
        $this->assertEquals(NilASTNode::NAME, $node->getName());
46
        $this->assertInstanceOf(NilASTNode::class, $node);
47
    }
48
49
    public function testTableKey() {
50
        $parser = new LuaParser(new LuaTokenStream(new LuaInputStream('["test"]')));
@@ 49-57 (lines=9) @@
46
        $this->assertInstanceOf(NilASTNode::class, $node);
47
    }
48
49
    public function testTableKey() {
50
        $parser = new LuaParser(new LuaTokenStream(new LuaInputStream('["test"]')));
51
52
        $node = $parser->parse();
53
54
        $this->assertEquals(StringASTNode::NAME, $node->getName());
55
        $this->assertInstanceOf(StringASTNode::class, $node);
56
        $this->assertEquals("test", $node->getValue());
57
    }
58
59
    public function testSimpleTable() {
60
        $parser = new LuaParser(