|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | use cli\Arguments; |
| 4 | +use WP_CLI\Tests\TestCase; |
4 | 5 |
|
5 | 6 | /** |
6 | 7 | * Class TestArguments |
7 | 8 | * @todo add more tests to increase coverage |
8 | 9 | * |
9 | 10 | * @backupGlobals enabled |
10 | 11 | */ |
11 | | -class TestArguments extends PHPUnit_Framework_TestCase |
| 12 | +class TestArguments extends TestCase |
12 | 13 | { |
13 | 14 | /** |
14 | 15 | * Array of expected settings |
@@ -58,7 +59,7 @@ public static function pushToArgv($args) |
58 | 59 | /** |
59 | 60 | * Set up valid flags and options |
60 | 61 | */ |
61 | | - public function setUp() |
| 62 | + public function set_up() |
62 | 63 | { |
63 | 64 | self::clearArgv(); |
64 | 65 | self::pushToArgv('my_script.php'); |
@@ -95,7 +96,7 @@ public function setUp() |
95 | 96 | /** |
96 | 97 | * Tear down fixtures |
97 | 98 | */ |
98 | | - public function tearDown() |
| 99 | + public function tear_down() |
99 | 100 | { |
100 | 101 | $this->flags = null; |
101 | 102 | $this->options = null; |
@@ -255,11 +256,11 @@ public function testParseWithValidOptions($cliParams, $expectedValues) |
255 | 256 | * @param array $args arguments as they appear in the cli |
256 | 257 | * @param array $expectedValues expected values after parsing |
257 | 258 | * @dataProvider settingsWithMissingOptions |
258 | | - * @expectedException PHPUnit_Framework_Error_Warning |
259 | | - * @expectedExceptionMessage no value given for --option1 |
260 | 259 | */ |
261 | 260 | public function testParseWithMissingOptions($cliParams, $expectedValues) |
262 | 261 | { |
| 262 | + $this->expectWarning(); |
| 263 | + $this->expectWarningMessage('no value given for --option1'); |
263 | 264 | $this->_testParse($cliParams, $expectedValues); |
264 | 265 | } |
265 | 266 |
|
|
0 commit comments