Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PassedParameters::getParameter(): add one extra test #262

Merged
merged 1 commit into from
May 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Tests/Utils/PassedParameters/GetParametersWithLimitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class GetParametersWithLimitTest extends UtilityMethodTestCase
/**
* Test retrieving the parameter details with a limit from an array without parameters.
*
* @covers \PHPCSUtils\Utils\PassedParameters::getParameters
* @covers \PHPCSUtils\Utils\PassedParameters::getParameter
*
* @return void
*/
public function testGetParametersWithLimitNoParams()
Expand All @@ -38,6 +41,10 @@ public function testGetParametersWithLimitNoParams()
$result = PassedParameters::getParameters(self::$phpcsFile, $stackPtr, 3);
$this->assertSame([], $result);
$this->assertCount(0, $result);

// Limit is automatically applied to getParameter().
$result = PassedParameters::getParameter(self::$phpcsFile, $stackPtr, 3);
$this->assertFalse($result);
}

/**
Expand Down