Add pear modules, mail and net_smtp via composer (#93)
Add pear modules, mail and net_smtp via composer, remove php 5.6 build due to phpunit 6
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
namespace Consolidation\AnnotatedCommand;
|
||||
|
||||
use Consolidation\AnnotatedCommand\Parser\CommandInfo;
|
||||
use Consolidation\AnnotatedCommand\Parser\CommandInfoSerializer;
|
||||
use Consolidation\AnnotatedCommand\Parser\CommandInfoDeserializer;
|
||||
|
||||
class CommandInfoTests extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
@@ -22,8 +24,31 @@ class CommandInfoTests extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function testParsing()
|
||||
{
|
||||
$commandInfo = new CommandInfo('\Consolidation\TestUtils\ExampleCommandFile', 'testArithmatic');
|
||||
$commandInfo = CommandInfo::create('\Consolidation\TestUtils\ExampleCommandFile', 'testArithmatic');
|
||||
$this->assertCommandInfoIsAsExpected($commandInfo);
|
||||
|
||||
$serializer = new CommandInfoSerializer();
|
||||
$serialized = $serializer->serialize($commandInfo);
|
||||
|
||||
$deserializer = new CommandInfoDeserializer();
|
||||
|
||||
$deserializedCommandInfo = $deserializer->deserialize($serialized);
|
||||
$this->assertCommandInfoIsAsExpected($deserializedCommandInfo);
|
||||
}
|
||||
|
||||
function testWithConfigImport()
|
||||
{
|
||||
$commandInfo = CommandInfo::create('\Consolidation\TestUtils\ExampleCommandFile', 'import');
|
||||
$this->assertEquals('config:import', $commandInfo->getName());
|
||||
|
||||
$this->assertEquals(
|
||||
'A config directory label (i.e. a key in \$config_directories array in settings.php).',
|
||||
$commandInfo->arguments()->getDescription('label')
|
||||
);
|
||||
}
|
||||
|
||||
function assertCommandInfoIsAsExpected($commandInfo)
|
||||
{
|
||||
$this->assertEquals('test:arithmatic', $commandInfo->getName());
|
||||
$this->assertEquals(
|
||||
'This is the test:arithmatic command',
|
||||
@@ -46,15 +71,31 @@ class CommandInfoTests extends \PHPUnit_Framework_TestCase
|
||||
'The other number to add.',
|
||||
$commandInfo->arguments()->getDescription('two')
|
||||
);
|
||||
$this->assertEquals(
|
||||
'2',
|
||||
$commandInfo->arguments()->get('two')
|
||||
);
|
||||
$this->assertEquals(
|
||||
'Whether or not the result should be negated.',
|
||||
$commandInfo->options()->getDescription('negate')
|
||||
);
|
||||
$this->assertEquals(
|
||||
'bob',
|
||||
$commandInfo->options()->get('unused')
|
||||
);
|
||||
$this->assertEquals(
|
||||
'one,two',
|
||||
$commandInfo->getAnnotation('dup')
|
||||
);
|
||||
$this->assertEquals(
|
||||
['one','two'],
|
||||
$commandInfo->getAnnotationList('dup')
|
||||
);
|
||||
}
|
||||
|
||||
function testReturnValue()
|
||||
{
|
||||
$commandInfo = new CommandInfo('\Consolidation\TestUtils\alpha\AlphaCommandFile', 'exampleTable');
|
||||
$commandInfo = CommandInfo::create('\Consolidation\TestUtils\alpha\AlphaCommandFile', 'exampleTable');
|
||||
$this->assertEquals('example:table', $commandInfo->getName());
|
||||
$this->assertEquals('\Consolidation\OutputFormatters\StructuredData\RowsOfFields', $commandInfo->getReturnType());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user