public function shift($num = 1)
{
for ($i = $num; $i > 1; $i--) {
$this->shift(--$i);
}
$this->params['command'] = $this->params['action'];
if (isset($this->params['args'][0])) {
$this->params['action'] = array_shift($this->params['args']);
}
return $this;
}
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); }