mirror of
https://github.com/zoe-may/TDoG-Skin.git
synced 2025-01-19 19:27:25 +08:00
29 lines
781 B
PHP
29 lines
781 B
PHP
|
<?php
|
||
|
|
||
|
namespace Tests;
|
||
|
|
||
|
use Blessing\Rejection;
|
||
|
use PHPUnit\Framework\TestCase;
|
||
|
|
||
|
class RejectionTest extends TestCase
|
||
|
{
|
||
|
public function testGetReason()
|
||
|
{
|
||
|
$reason = 'rejected';
|
||
|
$rejection = new Rejection($reason);
|
||
|
$this->assertEquals($reason, $rejection->getReason());
|
||
|
}
|
||
|
|
||
|
public function testGetData()
|
||
|
{
|
||
|
$rejection = new Rejection('', 'data');
|
||
|
$this->assertEquals('data', $rejection->getData());
|
||
|
|
||
|
$rejection = new Rejection('', ['a' => 'b']);
|
||
|
$this->assertEquals('b', $rejection->getData('a'));
|
||
|
$this->assertNull($rejection->getData('nope'));
|
||
|
$this->assertEquals('default', $rejection->getData('nope', 'default'));
|
||
|
$this->assertEquals(['a' => 'b'], $rejection->getData());
|
||
|
}
|
||
|
}
|