Permalink
Browse files

Use better assertion.

  • Loading branch information...
yutmr committed Jan 6, 2017
1 parent 072d8cf commit 9d9e6ad4fff39ac7c3f0eb3538755206b252dc28
Showing with 7 additions and 7 deletions.
  1. +7 −7 tests/TestCase/Utility/HashTest.php
@@ -470,27 +470,27 @@ public function testMaxDimensions()
{
$data = [];
$result = Hash::maxDimensions($data);
$this->assertEquals(0, $result);
$this->assertSame(0, $result);
$data = ['a', 'b'];
$result = Hash::maxDimensions($data);
$this->assertEquals(1, $result);
$this->assertSame(1, $result);
$data = ['1' => '1.1', '2', '3' => ['3.1' => '3.1.1']];
$result = Hash::maxDimensions($data);
$this->assertEquals($result, 2);
$this->assertSame(2, $result);
$data = ['1' => ['1.1' => '1.1.1'], '2', '3' => ['3.1' => ['3.1.1' => '3.1.1.1']]];
$result = Hash::maxDimensions($data);
$this->assertEquals($result, 3);
$this->assertSame(3, $result);
$data = [
'1' => ['1.1' => '1.1.1'],
['2' => ['2.1' => ['2.1.1' => '2.1.1.1']]],
'3' => ['3.1' => ['3.1.1' => '3.1.1.1']]
];
$result = Hash::maxDimensions($data);
$this->assertEquals($result, 4);
$this->assertSame(4, $result);
$data = [
'1' => [
@@ -505,14 +505,14 @@ public function testMaxDimensions()
'2' => ['2.1' => '2.1.1']
];
$result = Hash::maxDimensions($data);
$this->assertEquals($result, 5);
$this->assertSame(5, $result);
$data = [
'1' => false,
'2' => ['2.1' => '2.1.1']
];
$result = Hash::maxDimensions($data);
$this->assertEquals($result, 2);
$this->assertSame(2, $result);
}
/**

0 comments on commit 9d9e6ad

Please sign in to comment.