/** * @expectedException \BadMethodCallException */ public function testMagicMethodShouldThrowException() { // More than 2 arguements should throw an exception. $this->config->foo('key', null, null); }