| Total Complexity | 3 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace DocLister\Tests; |
||
| 5 | class APIhelpersTest extends \PHPUnit_Framework_TestCase |
||
| 6 | { |
||
| 7 | protected $data = array( |
||
| 8 | 'subArray' => array( |
||
| 9 | 'a', |
||
| 10 | 'b', |
||
| 11 | 'c' |
||
| 12 | ), |
||
| 13 | 'empty' => null, |
||
| 14 | 'scalar' => 'my string', |
||
| 15 | 'only_value', |
||
| 16 | '10' => 'value_with_number_key', |
||
| 17 | ); |
||
| 18 | |||
| 19 | public function testGetKeyWithEmptyKey() |
||
| 20 | { |
||
| 21 | $this->assertEquals(null, APIhelpers::getkey($this->data, 'empty')); |
||
| 22 | $this->assertEquals(null, APIhelpers::getkey($this->data, 'empty', 'my default')); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function testGetKeyWithNoKey() |
||
| 26 | { |
||
| 27 | $this->assertEquals('only_value', APIhelpers::getkey($this->data, 0)); |
||
| 28 | $this->assertEquals('value_with_number_key', APIhelpers::getkey($this->data, 10)); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function testGetKeyWithArrayKey() |
||
| 34 | } |
||
| 35 | } |
||
| 36 |