Skip to content

Commit 9a6791d

Browse files
committed
Tests: Correct missing-URL coverage for the RSS widget.
Fix the misspelled `url` key so the missing-URL dataset actually removes the setting. Remove an unused branch from the successful-URL test and declare both data providers static. Developed in: #14341 Props shailu25. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@64419 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 851f537 commit 9a6791d

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

‎tests/phpunit/tests/widgets/wpWidgetRss.php‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ public function test_url_unhappy_path( $url ) {
3434
);
3535

3636
if ( is_null( $url ) ) {
37-
unset( $instance['ur'] );
37+
unset( $instance['url'] );
3838
}
3939

4040
$this->expectOutputString( '' );
4141

4242
$widget->widget( $args, $instance );
4343
}
4444

45-
public function data_url_unhappy_path() {
45+
public static function data_url_unhappy_path() {
4646
return array(
4747
'when unset' => array(
4848
'url' => null,
@@ -79,18 +79,14 @@ public function test_url_happy_path( $url, $expected ) {
7979
'url' => $url,
8080
);
8181

82-
if ( is_null( $url ) ) {
83-
unset( $instance['ur'] );
84-
}
85-
8682
ob_start();
8783
$widget->widget( $args, $instance );
8884
$actual = ob_get_clean();
8985

9086
$this->assertStringContainsString( $expected, $actual );
9187
}
9288

93-
public function data_url_happy_path() {
89+
public static function data_url_happy_path() {
9490
return array(
9591
'when url is given' => array(
9692
'url' => 'https://wordpress.org/news/feed/',

0 commit comments

Comments
 (0)