From 1817c140aa7bd23702f8d5535c3b6aed3da404c2 Mon Sep 17 00:00:00 2001 From: Jwalit Shah Date: Mon, 4 Sep 2023 17:30:48 +1000 Subject: [PATCH] fix phpcpd errors --- tests/tool_excimer_flamed3_node_test.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/tool_excimer_flamed3_node_test.php b/tests/tool_excimer_flamed3_node_test.php index 2b90b36..7ca9a4c 100644 --- a/tests/tool_excimer_flamed3_node_test.php +++ b/tests/tool_excimer_flamed3_node_test.php @@ -63,25 +63,31 @@ public function test_add_excimer_trace_tail(): void { $trace = [['function' => 'a'], ['function' => 'd'], ['function' => 'e']]; $node->add_excimer_trace_tail($trace, 1); + $nodechildname = $node->children[0]->name; + $nodedoublechildname = $node->children[0]->children[0]->name; + $nodetriplechildname = $node->children[0]->children[0]->children[0]->name; $this->assertEquals(3, $node->value); $this->assertEquals(1, count($node->children)); - $this->assertEquals('a', $node->children[0]->name); + $this->assertEquals('a', $nodechildname); $this->assertEquals(2, $node->children[0]->value); - $this->assertEquals('b', $node->children[0]->children[0]->name); - $this->assertEquals('c', $node->children[0]->children[0]->children[0]->name); + $this->assertEquals('b', $nodedoublechildname); + $this->assertEquals('c', $nodetriplechildname); $this->assertEquals('a', $node->children[0]->name); $this->assertEquals('d', $node->children[0]->children[1]->name); $this->assertEquals('e', $node->children[0]->children[1]->children[0]->name); $trace = [['function' => 'm'], ['function' => 'n'], ['function' => 'e']]; $node->add_excimer_trace_tail($trace, 1); + $nodechildname = $node->children[0]->name; + $nodedoublechildname = $node->children[0]->children[0]->name; + $nodetriplechildname = $node->children[0]->children[0]->children[0]->name; $this->assertEquals(4, $node->value); $this->assertEquals(2, count($node->children)); - $this->assertEquals('a', $node->children[0]->name); + $this->assertEquals('a', $nodechildname); $this->assertEquals(2, $node->children[0]->value); - $this->assertEquals('b', $node->children[0]->children[0]->name); - $this->assertEquals('c', $node->children[0]->children[0]->children[0]->name); - $this->assertEquals('a', $node->children[0]->name); + $this->assertEquals('b', $nodedoublechildname); + $this->assertEquals('c', $nodetriplechildname); + $this->assertEquals('a', $nodechildname); $this->assertEquals('d', $node->children[0]->children[1]->name); $this->assertEquals('e', $node->children[0]->children[1]->children[0]->name); $this->assertEquals('m', $node->children[1]->name);