Skip to content

Commit be4e6fe

Browse files
committed
Simplify test.
1 parent 21b7202 commit be4e6fe

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/TestCase/View/Helper/ToolbarHelperTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,18 @@ public function testDumpCoerceHtml()
8686

8787
public function testDumpSorted()
8888
{
89-
$getValues = function ($el) {
90-
return strval($el);
91-
};
9289
$path = '//*[@class="cake-dbg-array-item"]/*[@class="cake-dbg-string"]';
9390
$data = ['z' => 1, 'a' => 99, 'm' => 123];
9491
$result = $this->Toolbar->dump($data);
9592
$xml = new SimpleXmlElement($result);
9693
$elements = $xml->xpath($path);
97-
$this->assertSame(["'z'", "'a'", "'m'"], array_map($getValues, $elements));
94+
$this->assertSame(["'z'", "'a'", "'m'"], array_map('strval', $elements));
9895

9996
$this->Toolbar->setSort(true);
10097
$result = $this->Toolbar->dump($data);
10198
$xml = new SimpleXmlElement($result);
10299
$elements = $xml->xpath($path);
103-
$this->assertSame(["'a'", "'m'", "'z'"], array_map($getValues, $elements));
100+
$this->assertSame(["'a'", "'m'", "'z'"], array_map('strval', $elements));
104101
}
105102

106103
/**

0 commit comments

Comments
 (0)