1: <?php
2: namespace tests\unit\barebones\utilities;
3:
4: use tests\unit\barebones\lib\BarebonesTestCase;
5: use barebones\utilities\Arrays;
6:
7:
8: class ArraysTest extends BarebonesTestCase
9: {
10: public function testIsAsociative()
11: {
12: $this->assertTrue(Arrays::isAssociativeArray(array('a' => 'b')));
13: $this->assertTrue(Arrays::isAssociativeArray(array('1' => 'a')));
14: $this->assertTrue(Arrays::isAssociativeArray(array('1' => '1')));
15: $this->assertTrue(Arrays::isAssociativeArray(
16: array(
17: '0' => '0',
18: '2' => '2',
19: )));
20:
21: $this->assertNotTrue(Arrays::isAssociativeArray(array('a')));
22: $this->assertNotTrue(Arrays::isAssociativeArray(array('0' => '0')));
23: $this->assertNotTrue(Arrays::isAssociativeArray(
24: array(
25: '0' => 'a',
26: '1' => 'b',
27: )));
28: }
29: }
30: