Exemplo n.º 1
0
 function test_pull()
 {
     $data = array('developer1' => 'Tonya', 'developer2' => 'Julie');
     $this->assertEquals('Julie', Arr::pull($data, 'developer2'));
     $this->assertEquals(array('developer1' => 'Tonya'), $data);
     $this->assertEquals('Tonya', wpdevsclub_array_pull($data, 'developer1'));
     $this->assertEquals(array(), $data);
 }
Exemplo n.º 2
0
 /**
  * Pulls an item from the collection.
  *
  * @param  mixed  $key
  * @param  mixed  $default
  * @return mixed
  */
 public function pull($key, $default = null)
 {
     return wpdevsclub_array_pull($this->items, $key, $default);
 }