Наследование: extends lithium\core\Object
Пример #1
0
 /**
  * Tests that the correct parameters are always passed in Object::invokeMethod(), regardless of
  * the number.
  *
  * @return void
  */
 public function testMethodInvocationWithParameters()
 {
     $callable = new MockCallable();
     $this->assertEqual($callable->invokeMethod('foo'), array());
     $this->assertEqual($callable->invokeMethod('foo', array('bar')), array('bar'));
     $params = array('one', 'two');
     $this->assertEqual($callable->invokeMethod('foo', $params), $params);
     $params = array('short', 'parameter', 'list');
     $this->assertEqual($callable->invokeMethod('foo', $params), $params);
     $params = array('a', 'longer', 'parameter', 'list');
     $this->assertEqual($callable->invokeMethod('foo', $params), $params);
     $params = array('a', 'much', 'longer', 'parameter', 'list');
     $this->assertEqual($callable->invokeMethod('foo', $params), $params);
     $params = array('an', 'extremely', 'long', 'list', 'of', 'parameters');
     $this->assertEqual($callable->invokeMethod('foo', $params), $params);
     $params = array('an', 'extremely', 'long', 'list', 'of', 'parameters');
     $this->assertEqual($callable->invokeMethod('foo', $params), $params);
     $params = array('if', 'you', 'have', 'a', 'parameter', 'list', 'this', 'long', 'then', 'UR', 'DOIN', 'IT', 'RONG');
     $this->assertEqual($callable->invokeMethod('foo', $params), $params);
 }