-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
112 additions
and
30 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,11 @@ | ||
<?php | ||
|
||
namespace Ouxsoft\LuckByDice\Contract; | ||
|
||
use Ouxsoft\LuckByDice\Cup; | ||
|
||
interface NotationInterface | ||
{ | ||
public function encode(Cup $cup) : string; | ||
public function decode(string $expression) : array; | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
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
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
Empty file.
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,62 @@ | ||
<?php | ||
/* | ||
* This file is part of the LuckByDice package. | ||
* | ||
* (c) 2017-2021 Ouxsoft <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Ouxsoft\LivingMarkup\Tests\Unit; | ||
|
||
use Laminas\Http\Exception\OutOfRangeException; | ||
use Ouxsoft\LuckByDice\Dice; | ||
use PHPUnit\Framework\TestCase; | ||
use Ouxsoft\LuckByDice\Factory\TurnFactory; | ||
|
||
class DiceTest extends TestCase | ||
{ | ||
private $dice; | ||
|
||
public function setUp(): void | ||
{ | ||
$this->dice = new Dice(6); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
unset($this->dice); | ||
} | ||
|
||
|
||
/** | ||
* @covers \Ouxsoft\LuckByDice\Dice::__construct | ||
*/ | ||
public function test__construct() | ||
{ | ||
$slides = $this->dice->getSides(); | ||
$this->assertEquals(6, $slides); | ||
|
||
$this->expectException(\OutOfRangeException::class); | ||
$this->dice = new Dice(1); | ||
} | ||
|
||
/** | ||
* @covers \Ouxsoft\LuckByDice\Dice::roll | ||
*/ | ||
public function testRoll() | ||
{ | ||
$outcome = $this->dice->roll(); | ||
$this->assertIsInt($outcome); | ||
} | ||
|
||
/** | ||
* @covers \Ouxsoft\LuckByDice\Dice::getSides | ||
*/ | ||
public function testGetSides() | ||
{ | ||
$slides = $this->dice->getSides(); | ||
$this->assertEquals(6, $slides); | ||
} | ||
} |