|
@@ 57-63 (lines=7) @@
|
| 54 |
|
* @return void |
| 55 |
|
* @since 1.1.0 |
| 56 |
|
*/ |
| 57 |
|
public function testAssignsInputArgumentToInputProperty() |
| 58 |
|
{ |
| 59 |
|
$args = array('foo.php', __FILE__, 'text', 'design'); |
| 60 |
|
$opts = new CommandLineOptions($args); |
| 61 |
|
|
| 62 |
|
self::assertEquals(__FILE__, $opts->getInputPath()); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
/** |
| 66 |
|
* testAssignsFormatArgumentToReportFormatProperty |
|
@@ 71-77 (lines=7) @@
|
| 68 |
|
* @return void |
| 69 |
|
* @since 1.1.0 |
| 70 |
|
*/ |
| 71 |
|
public function testAssignsFormatArgumentToReportFormatProperty() |
| 72 |
|
{ |
| 73 |
|
$args = array('foo.php', __FILE__, 'text', 'design'); |
| 74 |
|
$opts = new CommandLineOptions($args); |
| 75 |
|
|
| 76 |
|
self::assertEquals('text', $opts->getReportFormat()); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
/** |
| 80 |
|
* testAssignsRuleSetsArgumentToRuleSetProperty |
|
@@ 85-91 (lines=7) @@
|
| 82 |
|
* @return void |
| 83 |
|
* @since 1.1.0 |
| 84 |
|
*/ |
| 85 |
|
public function testAssignsRuleSetsArgumentToRuleSetProperty() |
| 86 |
|
{ |
| 87 |
|
$args = array('foo.php', __FILE__, 'text', 'design'); |
| 88 |
|
$opts = new CommandLineOptions($args); |
| 89 |
|
|
| 90 |
|
self::assertEquals('design', $opts->getRuleSets()); |
| 91 |
|
} |
| 92 |
|
|
| 93 |
|
/** |
| 94 |
|
* testThrowsExpectedExceptionWhenRequiredArgumentsNotSet |
|
@@ 112-120 (lines=9) @@
|
| 109 |
|
* @return void |
| 110 |
|
* @since 1.1.0 |
| 111 |
|
*/ |
| 112 |
|
public function testAssignsInputFileOptionToInputPathProperty() |
| 113 |
|
{ |
| 114 |
|
$uri = self::createResourceUriForTest('inputfile.txt'); |
| 115 |
|
|
| 116 |
|
$args = array('foo.php', 'text', 'design', '--inputfile', $uri); |
| 117 |
|
$opts = new CommandLineOptions($args); |
| 118 |
|
|
| 119 |
|
self::assertEquals('Dir1/Class1.php,Dir2/Class2.php', $opts->getInputPath()); |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
/** |
| 123 |
|
* testAssignsFormatArgumentCorrectWhenCalledWithInputFile |
|
@@ 128-136 (lines=9) @@
|
| 125 |
|
* @return void |
| 126 |
|
* @since 1.1.0 |
| 127 |
|
*/ |
| 128 |
|
public function testAssignsFormatArgumentCorrectWhenCalledWithInputFile() |
| 129 |
|
{ |
| 130 |
|
$uri = self::createResourceUriForTest('inputfile.txt'); |
| 131 |
|
|
| 132 |
|
$args = array('foo.php', 'text', 'design', '--inputfile', $uri); |
| 133 |
|
$opts = new CommandLineOptions($args); |
| 134 |
|
|
| 135 |
|
self::assertEquals('text', $opts->getReportFormat()); |
| 136 |
|
} |
| 137 |
|
|
| 138 |
|
/** |
| 139 |
|
* testAssignsRuleSetsArgumentCorrectWhenCalledWithInputFile |
|
@@ 144-152 (lines=9) @@
|
| 141 |
|
* @return void |
| 142 |
|
* @since 1.1.0 |
| 143 |
|
*/ |
| 144 |
|
public function testAssignsRuleSetsArgumentCorrectWhenCalledWithInputFile() |
| 145 |
|
{ |
| 146 |
|
$uri = self::createResourceUriForTest('inputfile.txt'); |
| 147 |
|
|
| 148 |
|
$args = array('foo.php', 'text', 'design', '--inputfile', $uri); |
| 149 |
|
$opts = new CommandLineOptions($args); |
| 150 |
|
|
| 151 |
|
self::assertEquals('design', $opts->getRuleSets()); |
| 152 |
|
} |
| 153 |
|
|
| 154 |
|
/** |
| 155 |
|
* testThrowsExpectedExceptionWhenInputFileNotExists |