Skip to content

Commit

Permalink
Loosen test assertion as the specs do not guarantee the key order
Browse files Browse the repository at this point in the history
  • Loading branch information
ravage84 committed Sep 5, 2018
1 parent c5a2056 commit 907ba79
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/TestCase/Cache/SimpleCacheEngineTest.php
Expand Up @@ -275,6 +275,9 @@ public function testGetMultipleDefault()
/**
* Test setMultiple
*
* We should not assert for array equality, as the PSR-16 specs
* do not make any guarantees on key order.
*
* @return void
* @covers ::setMultiple
*/
Expand All @@ -284,10 +287,14 @@ public function testSetMultiple()
'key' => 'a value',
'key2' => 'other value',
];
$expected = [
'key2' => 'other value',
'key' => 'a value',
];
$this->cache->setMultiple($data);

$results = $this->cache->getMultiple(array_keys($data));
$this->assertSame($data, $results);
$this->assertEquals($expected, $results);
}

/**
Expand Down

0 comments on commit 907ba79

Please sign in to comment.