-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tests): Add new test file for SudoPassword
- Add HasSudoPasswordTest.php for testing set and get methods of SudoPassword. - Add test for checking the type of escapedSudoPassword.
- Loading branch information
Showing
3 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of the guanguans/soar-php. | ||
* | ||
* (c) guanguans <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled. | ||
*/ | ||
|
||
namespace Guanguans\Tests\Concerns; | ||
|
||
use Guanguans\SoarPHP\Soar; | ||
use Guanguans\Tests\TestCase; | ||
|
||
/** | ||
* @internal | ||
* | ||
* @small | ||
*/ | ||
class HasSudoPasswordTest extends TestCase | ||
{ | ||
public function testSetSudoPassword(): void | ||
{ | ||
$soar = Soar::create(); | ||
$soar->setSudoPassword($sudoPassword = 'foo'); | ||
|
||
$this->assertSame($sudoPassword, $soar->getSudoPassword()); | ||
} | ||
|
||
public function testGetEscapedSudoPassword(): void | ||
{ | ||
$soar = Soar::create(); | ||
$escapedSudoPassword = (function (Soar $soar): string { | ||
return $soar->getEscapedSudoPassword(); | ||
})->call($soar, $soar); | ||
|
||
$this->assertIsString($escapedSudoPassword); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters