mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Coding Standards: Fix and whitelist variable names.
From the `WordPress.NamingConventions.ValidVariableName` sniff, this commit fixes/whitelists all `NotSnakeCaseMemberVar`, `MemberNotSnakeCase`, and `StringNotSnakeCase` violations. It also fixes a handful of the `NotSnakeCase` violations. See #45934. git-svn-id: https://develop.svn.wordpress.org/trunk@44573 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -103,21 +103,21 @@ class Tests_Avatar extends WP_UnitTestCase {
|
||||
$this->assertEquals( $url, $url2 );
|
||||
}
|
||||
|
||||
protected $fakeURL;
|
||||
protected $fake_url;
|
||||
/**
|
||||
* @ticket 21195
|
||||
*/
|
||||
public function test_pre_get_avatar_url_filter() {
|
||||
$this->fakeURL = 'haha wat';
|
||||
$this->fake_url = 'haha wat';
|
||||
|
||||
add_filter( 'pre_get_avatar_data', array( $this, 'pre_get_avatar_url_filter' ), 10, 1 );
|
||||
$url = get_avatar_url( 1 );
|
||||
remove_filter( 'pre_get_avatar_data', array( $this, 'pre_get_avatar_url_filter' ), 10 );
|
||||
|
||||
$this->assertEquals( $url, $this->fakeURL );
|
||||
$this->assertEquals( $url, $this->fake_url );
|
||||
}
|
||||
public function pre_get_avatar_url_filter( $args ) {
|
||||
$args['url'] = $this->fakeURL;
|
||||
$args['url'] = $this->fake_url;
|
||||
return $args;
|
||||
}
|
||||
|
||||
@@ -125,16 +125,16 @@ class Tests_Avatar extends WP_UnitTestCase {
|
||||
* @ticket 21195
|
||||
*/
|
||||
public function test_get_avatar_url_filter() {
|
||||
$this->fakeURL = 'omg lol';
|
||||
$this->fake_url = 'omg lol';
|
||||
|
||||
add_filter( 'get_avatar_url', array( $this, 'get_avatar_url_filter' ), 10, 1 );
|
||||
$url = get_avatar_url( 1 );
|
||||
remove_filter( 'get_avatar_url', array( $this, 'get_avatar_url_filter' ), 10 );
|
||||
|
||||
$this->assertEquals( $url, $this->fakeURL );
|
||||
$this->assertEquals( $url, $this->fake_url );
|
||||
}
|
||||
public function get_avatar_url_filter( $url ) {
|
||||
return $this->fakeURL;
|
||||
return $this->fake_url;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,37 +207,37 @@ class Tests_Avatar extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
|
||||
protected $fakeIMG;
|
||||
protected $fake_img;
|
||||
/**
|
||||
* @ticket 21195
|
||||
*/
|
||||
public function test_pre_get_avatar_filter() {
|
||||
$this->fakeIMG = 'YOU TOO?!';
|
||||
$this->fake_img = 'YOU TOO?!';
|
||||
|
||||
add_filter( 'pre_get_avatar', array( $this, 'pre_get_avatar_filter' ), 10, 1 );
|
||||
$img = get_avatar( 1 );
|
||||
remove_filter( 'pre_get_avatar', array( $this, 'pre_get_avatar_filter' ), 10 );
|
||||
|
||||
$this->assertEquals( $img, $this->fakeIMG );
|
||||
$this->assertEquals( $img, $this->fake_img );
|
||||
}
|
||||
public function pre_get_avatar_filter( $img ) {
|
||||
return $this->fakeIMG;
|
||||
return $this->fake_img;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 21195
|
||||
*/
|
||||
public function test_get_avatar_filter() {
|
||||
$this->fakeURL = 'YA RLY';
|
||||
$this->fake_url = 'YA RLY';
|
||||
|
||||
add_filter( 'get_avatar', array( $this, 'get_avatar_filter' ), 10, 1 );
|
||||
$img = get_avatar( 1 );
|
||||
remove_filter( 'get_avatar', array( $this, 'get_avatar_filter' ), 10 );
|
||||
|
||||
$this->assertEquals( $img, $this->fakeURL );
|
||||
$this->assertEquals( $img, $this->fake_url );
|
||||
}
|
||||
public function get_avatar_filter( $img ) {
|
||||
return $this->fakeURL;
|
||||
return $this->fake_url;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user