Skip to content

Commit

Permalink
Merge pull request #5912 from huzaifaalmesbah/fix-Inline-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed Mar 14, 2024
2 parents a76265b + 2643f56 commit 9aec20f
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 70 deletions.
72 changes: 36 additions & 36 deletions tests/test-commandfactory.php
Expand Up @@ -99,39 +99,39 @@ public function testGetDocComment() {
require __DIR__ . '/data/commandfactory-doc_comment-class-win.php';
}

// Class 1
// Class 1.

$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 1
// Class method 1.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command1' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 2
// Class method 2.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command2' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 3
// Class method 3.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command3' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 4
// Class method 4.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command4' );
$expected = $reflection->getDocComment();
Expand All @@ -140,39 +140,39 @@ public function testGetDocComment() {
$this->assertSame( $expected, $actual );
$this->assertFalse( $actual );

// Class 1 Windows
// Class 1 Windows.

$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 1
// Class method 1.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command1' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 2
// Class method 2.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command2' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 3
// Class method 3.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command3' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 4
// Class method 4.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command4' );
$expected = $reflection->getDocComment();
Expand All @@ -181,15 +181,15 @@ public function testGetDocComment() {
$this->assertSame( $expected, $actual );
$this->assertFalse( $actual );

// Class 2
// Class 2.

$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 1
// Class method 1.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command', 'command1' );
$expected = $reflection->getDocComment();
Expand All @@ -198,15 +198,15 @@ public function testGetDocComment() {
$this->assertSame( $expected, $actual );
$this->assertFalse( $actual );

// Class 2 Windows
// Class 2 Windows.

$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 1
// Class method 1.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win', 'command1' );
$expected = $reflection->getDocComment();
Expand All @@ -215,27 +215,27 @@ public function testGetDocComment() {
$this->assertSame( $expected, $actual );
$this->assertFalse( $actual );

// Functions
// Functions.

require __DIR__ . '/data/commandfactory-doc_comment-function.php';

// Function 1
// Function 1.

$reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_1' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Function 2
// Function 2.

$reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_2' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Function 3
// Function 3.

$reflection = new \ReflectionFunction( $commandfactorytests_get_doc_comment_func_3 );
$expected = $reflection->getDocComment();
Expand Down Expand Up @@ -267,39 +267,39 @@ public function testGetDocCommentWin() {
require __DIR__ . '/data/commandfactory-doc_comment-class-win.php';
}

// Class 1
// Class 1.

$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 1
// Class method 1.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command1' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 2
// Class method 2.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command2' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 3
// Class method 3.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command3' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 4
// Class method 4.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command4' );
$expected = $reflection->getDocComment();
Expand All @@ -308,39 +308,39 @@ public function testGetDocCommentWin() {
$this->assertSame( $expected, $actual );
$this->assertFalse( $actual );

// Class 1 Windows
// Class 1 Windows.

$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 1
// Class method 1.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command1' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 2
// Class method 2.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command2' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 3
// Class method 3.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command3' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 4
// Class method 4.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command4' );
$expected = $reflection->getDocComment();
Expand All @@ -349,15 +349,15 @@ public function testGetDocCommentWin() {
$this->assertSame( $expected, $actual );
$this->assertFalse( $actual );

// Class 2
// Class 2.

$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 1
// Class method 1.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command', 'command1' );
$expected = $reflection->getDocComment();
Expand All @@ -366,15 +366,15 @@ public function testGetDocCommentWin() {
$this->assertSame( $expected, $actual );
$this->assertFalse( $actual );

// Class 2 Windows
// Class 2 Windows.

$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Class method 1
// Class method 1.

$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win', 'command1' );
$expected = $reflection->getDocComment();
Expand All @@ -383,27 +383,27 @@ public function testGetDocCommentWin() {
$this->assertSame( $expected, $actual );
$this->assertFalse( $actual );

// Functions
// Functions.

require __DIR__ . '/data/commandfactory-doc_comment-function-win.php';

// Function 1 Windows
// Function 1 Windows.

$reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_1_win' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Function 2
// Function 2.

$reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_2_win' );
$expected = $reflection->getDocComment();

$actual = $get_doc_comment->invoke( null, $reflection );
$this->assertSame( $expected, $actual );

// Function 3
// Function 3.

$reflection = new \ReflectionFunction( $commandfactorytests_get_doc_comment_func_3_win );
$expected = $reflection->getDocComment();
Expand Down
4 changes: 2 additions & 2 deletions tests/test-configurator.php
Expand Up @@ -68,7 +68,7 @@ public function testNullGetConfig() {
$runner = WP_CLI::get_runner();
$runner->init_config();

// Previous
// Previous.
$prev_logger = WP_CLI::get_logger();

$logger = new Loggers\Execution();
Expand All @@ -81,7 +81,7 @@ public function testNullGetConfig() {
$this->assertTrue( false === strpos( $logger->stderr, 'Warning' ), 'Logger contains a "Warning"' );
$this->assertNull( $get_config, 'get_config() is not null' );

// Restore
// Restore.
WP_CLI::set_logger( $prev_logger );
}
}
2 changes: 1 addition & 1 deletion tests/test-file-cache.php
Expand Up @@ -74,7 +74,7 @@ public function test_ensure_dir_exists() {
$expected = "/^Warning: Failed to create directory '.+': mkdir\(\): File exists\.$/";
$this->assertMatchesRegularExpression( $expected, $logger->stderr );

// Restore
// Restore.
chmod( $cache_dir . '/test1', 0755 );
rmdir( $cache_dir . '/test1' );
unlink( $cache_dir . '/test2' );
Expand Down
12 changes: 6 additions & 6 deletions tests/test-inflector.php
Expand Up @@ -14,9 +14,9 @@ public function testPluralize( $singular, $expected ) {

public function dataProviderPluralize() {
return [
[ 'string', 'strings' ], // regular
[ 'person', 'people' ], // irregular
[ 'scissors', 'scissors' ], // uncountable
[ 'string', 'strings' ], // Regular.
[ 'person', 'people' ], // Irregular.
[ 'scissors', 'scissors' ], // Uncountable.
];
}

Expand All @@ -29,9 +29,9 @@ public function testSingularize( $singular, $expected ) {

public function dataProviderSingularize() {
return [
[ 'strings', 'string' ], // regular
[ 'people', 'person' ], // irregular
[ 'scissors', 'scissors' ], // uncountable
[ 'strings', 'string' ], // Regular.
[ 'people', 'person' ], // Irregular.
[ 'scissors', 'scissors' ], // Uncountable.
];
}
}
2 changes: 1 addition & 1 deletion tests/test-synopsis.php
Expand Up @@ -34,7 +34,7 @@ public function testFlag() {
$this->assertEquals( 'flag', $param['type'] );
$this->assertTrue( $param['optional'] );

// flags can't be mandatory
// Flags can't be mandatory.
$r = SynopsisParser::parse( '--foo' );

$this->assertCount( 1, $r );
Expand Down

0 comments on commit 9aec20f

Please sign in to comment.