shift() public method

Moves params up a level. Sets command to action, action to passed[0], and so on.
public shift ( integer $num = 1 ) : self
$num integer how many times to shift
return self
Esempio n. 1
0
 public function testShiftTwo()
 {
     $request = new Request();
     $request->params = array('command' => 'one', 'action' => 'two', 'args' => array('three', 'four', 'five'));
     $request->shift(2);
     $expected = array('command' => 'three', 'action' => 'four', 'args' => array('five'));
     $result = $request->params;
     $this->assertEqual($expected, $result);
 }