Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some tests for multibyte character support
- Loading branch information
Showing
2 changed files
with
81 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace League\CLImate\Tests\Argument; | ||
|
||
use League\CLImate\Argument\Argument; | ||
use League\CLImate\Argument\Manager; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ManagerTest extends TestCase | ||
{ | ||
private $manager; | ||
|
||
public function setUp() | ||
{ | ||
$this->manager = new Manager; | ||
} | ||
|
||
|
||
public function testDefined1() | ||
{ | ||
$argument = Argument::createFromArray("test", [ | ||
"prefix" => "t", | ||
"longPrefix" => "test", | ||
]); | ||
$this->manager->add($argument); | ||
|
||
$result = $this->manager->defined("test", ["command", "--test"]); | ||
|
||
$this->assertTrue($result); | ||
} | ||
public function testDefined2() | ||
{ | ||
$result = $this->manager->defined("test"); | ||
|
||
$this->assertFalse($result); | ||
} | ||
public function testDefined3() | ||
{ | ||
$argument = Argument::createFromArray("lorem", [ | ||
"prefix" => "l", | ||
"longPrefix" => "Лорем", | ||
]); | ||
$this->manager->add($argument); | ||
|
||
$result = $this->manager->defined("lorem", ["command", "--Лорем"]); | ||
|
||
$this->assertTrue($result); | ||
} | ||
} |
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