public function testSetDefault()
 {
     $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default');
     $argument->setDefault(null);
     $this->assertNull($argument->getDefault(), '->setDefault() can reset the default value by passing null');
     $argument->setDefault('another');
     $this->assertEquals('another', $argument->getDefault(), '->setDefault() changes the default value');
     $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY);
     $argument->setDefault(array(1, 2));
     $this->assertEquals(array(1, 2), $argument->getDefault(), '->setDefault() changes the default value');
     try {
         $argument = new InputArgument('foo', InputArgument::REQUIRED);
         $argument->setDefault('default');
         $this->fail('->setDefault() throws an Exception if you give a default value for a required argument');
     } catch (\Exception $e) {
         $this->assertInstanceOf('\\Exception', $e, '->parse() throws an \\InvalidArgumentException exception if an invalid option is passed');
         $this->assertEquals('Cannot set a default value except for Parameter::OPTIONAL mode.', $e->getMessage());
     }
     try {
         $argument = new InputArgument('foo', InputArgument::IS_ARRAY);
         $argument->setDefault('default');
         $this->fail('->setDefault() throws an Exception if you give a default value which is not an array for a IS_ARRAY option');
     } catch (\Exception $e) {
         $this->assertInstanceOf('\\Exception', $e, '->setDefault() throws an Exception if you give a default value which is not an array for a IS_ARRAY option');
         $this->assertEquals('A default value for an array argument must be an array.', $e->getMessage());
     }
 }
 public function testSetDefault()
 {
     $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default');
     $argument->setDefault(null);
     $this->assertTrue(is_null($argument->getDefault()), '->setDefault() can reset the default value by passing null');
     $argument->setDefault('another');
     $this->assertEquals($argument->getDefault(), 'another', '->setDefault() changes the default value');
     $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY);
     $argument->setDefault(array(1, 2));
     $this->assertEquals($argument->getDefault(), array(1, 2), '->setDefault() changes the default value');
     try {
         $argument = new InputArgument('foo', InputArgument::REQUIRED);
         $argument->setDefault('default');
         $this->fail('->setDefault() throws an Exception if you give a default value for a required argument');
     } catch (\Exception $e) {
     }
     try {
         $argument = new InputArgument('foo', InputArgument::IS_ARRAY);
         $argument->setDefault('default');
         $this->fail('->setDefault() throws an Exception if you give a default value which is not an array for a IS_ARRAY option');
     } catch (\Exception $e) {
     }
 }
// ->getDefault()
$t->diag('->getDefault()');
$argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default');
$t->is($argument->getDefault(), 'default', '->getDefault() return the default value');

// ->setDefault()
$t->diag('->setDefault()');
$argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default');
$argument->setDefault(null);
$t->ok(is_null($argument->getDefault()), '->setDefault() can reset the default value by passing null');
$argument->setDefault('another');
$t->is($argument->getDefault(), 'another', '->setDefault() changes the default value');

$argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY);
$argument->setDefault(array(1, 2));
$t->is($argument->getDefault(), array(1, 2), '->setDefault() changes the default value');

try
{
  $argument = new InputArgument('foo', InputArgument::REQUIRED);
  $argument->setDefault('default');
  $t->fail('->setDefault() throws an Exception if you give a default value for a required argument');
}
catch (\Exception $e)
{
  $t->pass('->setDefault() throws an Exception if you give a default value for a required argument');
}

try
{
  $argument = new InputArgument('foo', InputArgument::IS_ARRAY);