Ejemplo n.º 1
0
 public function testKeyFilter()
 {
     $this->assertCount(0, ArrayUtils::keyFilter($this->_getArrayPreset('empty_array'), 'id'));
     $this->assertCount(5, ArrayUtils::keyFilter($this->_getArrayPreset('2D_collection_5'), 'id'));
     $this->assertCount(5, ArrayUtils::keyFilter($this->_getArrayPreset('2D_collection_5'), 'categoryId'));
     $this->assertEmpty(ArrayUtils::keyFilter($this->_getArrayPreset('2D_collection_5'), 'undefined'));
     $this->assertContains('sit', ArrayUtils::keyFilter($this->_getArrayPreset('2D_collection_5'), 'name'));
     $this->assertArrayHasKey('sit', ArrayUtils::keyFilter($this->_getArrayPreset('2D_collection_5_named'), 'name', true));
 }